Bug 804926 - Move view initializations to initializeChrome(). r=kats
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 25 Oct 2012 09:55:19 -0700
changeset 111547 91698ac90375c09dd96e1bcf4bf78251156d9266
parent 111546 a09013468b3e29632d45edc4da0072f39e176767
child 111548 6ffa6c2557aef0e8909ff806544e41e5943b7a31
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewerskats
bugs804926
milestone19.0a1
Bug 804926 - Move view initializations to initializeChrome(). r=kats
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1543,16 +1543,29 @@ abstract public class GeckoApp
                 editor.putBoolean(GeckoApp.PREFS_WAS_STOPPED, false);
                 editor.commit();
             }
         });
     }
 
     protected void initializeChrome(String uri, Boolean isExternalURL) {
         mDoorHangerPopup = new DoorHangerPopup(this, null);
+        mPluginContainer = (AbsoluteLayout) findViewById(R.id.plugin_container);
+        mFormAssistPopup = (FormAssistPopup) findViewById(R.id.form_assist_popup);
+
+        if (cameraView == null) {
+            cameraView = new SurfaceView(this);
+            cameraView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
+        }
+
+        if (mLayerView == null) {
+            LayerView layerView = (LayerView) findViewById(R.id.layer_view);
+            layerView.initializeView(GeckoAppShell.getEventDispatcher());
+            mLayerView = layerView;
+        }
     }
 
     private void initialize() {
         mInitialized = true;
 
         invalidateOptionsMenu();
 
         Intent intent = getIntent();
@@ -1652,30 +1665,16 @@ abstract public class GeckoApp
             mMainHandler.postDelayed(new Runnable() {
                 public void run() {
                     setLaunchState(LaunchState.Launching);
                     sGeckoThread.start();
                 }
             }, 1000 * 5 /* 5 seconds */);
         }
 
-        if (cameraView == null) {
-            cameraView = new SurfaceView(this);
-            cameraView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
-        }
-
-        if (mLayerView == null) {
-            LayerView layerView = (LayerView) findViewById(R.id.layer_view);
-            layerView.initializeView(GeckoAppShell.getEventDispatcher());
-            mLayerView = layerView;
-        }
-
-        mPluginContainer = (AbsoluteLayout) findViewById(R.id.plugin_container);
-        mFormAssistPopup = (FormAssistPopup) findViewById(R.id.form_assist_popup);
-
         //register for events
         registerEventListener("DOMContentLoaded");
         registerEventListener("DOMTitleChanged");
         registerEventListener("DOMLinkAdded");
         registerEventListener("DOMWindowClose");
         registerEventListener("log");
         registerEventListener("Content:SecurityChange");
         registerEventListener("Content:ReaderEnabled");