Bug 1041632 - Part 1: eliminating enclosing instance member access in BaseGeckoInterface. r=ckitching
authorRichard Newman <rnewman@mozilla.com>
Mon, 21 Jul 2014 10:16:42 -0700
changeset 195364 79bd536c7ed2f6c8c402e0098de7f852019bea83
parent 195363 7ff31c7b215e102c61340eb3af71dadc002afab5
child 195365 159eea8f16838e2bec6adb7b7959b3f064b79985
push id46575
push userkwierso@gmail.com
push dateTue, 22 Jul 2014 00:35:21 +0000
treeherdermozilla-inbound@fee5c4bdd713 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckitching
bugs1041632
milestone33.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 1041632 - Part 1: eliminating enclosing instance member access in BaseGeckoInterface. r=ckitching
mobile/android/base/BaseGeckoInterface.java
--- a/mobile/android/base/BaseGeckoInterface.java
+++ b/mobile/android/base/BaseGeckoInterface.java
@@ -22,17 +22,17 @@ import android.widget.AbsoluteLayout;
 
 public class BaseGeckoInterface implements GeckoAppShell.GeckoInterface {
     // Bug 908744: Implement GeckoEventListener
     // Bug 908752: Implement SensorEventListener
     // Bug 908755: Implement LocationListener
     // Bug 908756: Implement Tabs.OnTabsChangedListener
     // Bug 908760: Implement GeckoEventResponder
 
-    private Context mContext;
+    private final Context mContext;
     private GeckoProfile mProfile;
 
     public BaseGeckoInterface(Context context) {
         mContext = context;
     }
 
     public GeckoProfile getProfile() {
         // Fall back to default profile if we didn't load a specific one
@@ -69,23 +69,24 @@ public class BaseGeckoInterface implemen
     // Bug 908775: Implement this
     public void doRestart() {}
 
     public void setFullScreen(final boolean fullscreen) {
         ThreadUtils.postToUiThread(new Runnable() {
             @Override
             public void run() {
                 // Hide/show the system notification bar
-                Window window = ((Activity)mContext).getWindow();
+                Window window = getActivity().getWindow();
                 window.setFlags(fullscreen ?
                                 WindowManager.LayoutParams.FLAG_FULLSCREEN : 0,
                                 WindowManager.LayoutParams.FLAG_FULLSCREEN);
 
-                if (Build.VERSION.SDK_INT >= 11)
+                if (Build.VERSION.SDK_INT >= 11) {
                     window.getDecorView().setSystemUiVisibility(fullscreen ? 1 : 0);
+                }
             }
         });
     }
 
     // Bug 908779: Implement this
     public void addPluginView(final View view, final RectF rect, final boolean isFullScreen) {}
 
     // Bug 908781: Implement this