bug 880259 - Firefox should use GeckoView r=mfinkle
☠☠ backed out by 8ba04505ce73 ☠ ☠
authorBrad Lassey <blassey@mozilla.com>
Fri, 02 Aug 2013 16:46:07 -0400
changeset 154846 5de4d20f6cfd311b5176b48e8691faff0fb9d8cd
parent 154715 aad7f060dadb283e0c5b80d8942c9803f040057e
child 154847 18e46e06c80f340fd182ec799fdb9ecc22a17f8f
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs880259
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 880259 - Firefox should use GeckoView r=mfinkle
CLOBBER
mobile/android/base/GeckoView.java
mobile/android/base/resources/layout/shared_ui_components.xml
mobile/android/base/resources/values/attrs.xml
--- a/CLOBBER
+++ b/CLOBBER
@@ -13,9 +13,9 @@
 #          |               |
 #          O <-- Clobber   O  <-- Clobber
 #
 # Note: The description below will be part of the error message shown to users.
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
-Add an WebIDL interface for bug 892978 requires a clobber for Windows.
+Changed a resource file in fennec, bug 880259
\ No newline at end of file
--- a/mobile/android/base/GeckoView.java
+++ b/mobile/android/base/GeckoView.java
@@ -26,52 +26,48 @@ import android.view.SurfaceHolder;
 import android.view.SurfaceView;
 import android.os.Handler;
 
 public class GeckoView extends LayerView
     implements GeckoEventListener, ContextGetter {
 
     public GeckoView(Context context, AttributeSet attrs) {
         super(context, attrs);
-
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GeckoView);
         String url = a.getString(R.styleable.GeckoView_url);
+        boolean doInit = a.getBoolean(R.styleable.GeckoView_doinit, true);
         a.recycle();
 
         if (url != null) {
             GeckoThread.setUri(url);
             GeckoThread.setAction(Intent.ACTION_VIEW);
             GeckoAppShell.sendEventToGecko(GeckoEvent.createURILoadEvent(url));
         }
         GeckoAppShell.setContextGetter(this);
         if (context instanceof Activity) {
             Tabs tabs = Tabs.getInstance();
             tabs.attachToContext(context);
         }
-        GeckoProfile profile = GeckoProfile.get(context);
-        BrowserDB.initialize(profile.getName());
         GeckoAppShell.registerEventListener("Gecko:Ready", this);
 
         ThreadUtils.setUiThread(Thread.currentThread(), new Handler());
         initializeView(GeckoAppShell.getEventDispatcher());
+
+        if (!doInit)
+            return;
+
+        GeckoProfile profile = GeckoProfile.get(context);
+        BrowserDB.initialize(profile.getName());
+
         if (GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.Launching, GeckoThread.LaunchState.Launched)) {
             GeckoAppShell.setLayerView(this);
             GeckoThread.createAndStart();
         }
     }
 
-    @Override
-    public void onWindowFocusChanged(boolean hasFocus) {
-        super.onWindowFocusChanged(hasFocus);
-
-        if (hasFocus) {
-            setBackgroundDrawable(null);
-        }
-    }
-
     public void loadUrl(String uri) {
         Tabs.getInstance().loadUrl(uri);
     }
 
     public void handleMessage(String event, JSONObject message) {
         if (event.equals("Gecko:Ready")) {
             GeckoThread.setLaunchState(GeckoThread.LaunchState.GeckoRunning);
             Tab selectedTab = Tabs.getInstance().getSelectedTab();
--- a/mobile/android/base/resources/layout/shared_ui_components.xml
+++ b/mobile/android/base/resources/layout/shared_ui_components.xml
@@ -1,21 +1,23 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!-- This file is used to include shared UI components in different gecko app
      layouts, such as gecko_app.xml and web_app.xml -->
 
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+       xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
-    <org.mozilla.gecko.gfx.LayerView android:id="@+id/layer_view"
-                                     android:layout_width="fill_parent"
-                                     android:layout_height="fill_parent"/>
+    <org.mozilla.gecko.GeckoView android:id="@+id/layer_view"
+                                 gecko:doinit="false"
+                                 android:layout_width="fill_parent"
+                                 android:layout_height="fill_parent"/>
 
     <AbsoluteLayout android:id="@+id/plugin_container"
                     android:background="@android:color/transparent"
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent"/>
 
     <org.mozilla.gecko.FormAssistPopup android:id="@+id/form_assist_popup"
                                        android:layout_width="fill_parent"
--- a/mobile/android/base/resources/values/attrs.xml
+++ b/mobile/android/base/resources/values/attrs.xml
@@ -168,12 +168,13 @@
         <!-- Imported from AbsListView -->
         <attr name="android:choiceMode"/>
         <attr name="android:drawSelectorOnTop"/>
         <attr name="android:listSelector"/>
     </declare-styleable>
 
     <declare-styleable name="GeckoView">
         <attr name="url" format="string"/>
+        <attr name="doinit" format="boolean"/>
     </declare-styleable>
 
 </resources>