Bug 1366770 - Implement ContentListener.onFullScreen() for custom tabs. r=snorp
authorDylan Roeh <droeh@mozilla.com>
Wed, 09 Aug 2017 10:02:22 -0500
changeset 373906 66d4f2c88db7a19422e3252d4ef7312c8336f303
parent 373905 c3108aebee35c4fc2ac04ea19fd17534bf606d64
child 373907 26a6792f29beed0dad75499f0df6b653dd17240f
push id32311
push userkwierso@gmail.com
push dateFri, 11 Aug 2017 01:14:57 +0000
treeherdermozilla-central@253a8560dc34 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1366770
milestone57.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 1366770 - Implement ContentListener.onFullScreen() for custom tabs. r=snorp
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -37,16 +37,17 @@ import org.mozilla.gecko.GeckoViewSettin
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.SnackbarBuilder;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.menu.GeckoMenu;
 import org.mozilla.gecko.menu.GeckoMenuInflater;
 import org.mozilla.gecko.mozglue.SafeIntent;
 import org.mozilla.gecko.prompts.PromptService;
+import org.mozilla.gecko.util.ActivityUtils;
 import org.mozilla.gecko.util.Clipboard;
 import org.mozilla.gecko.util.ColorUtil;
 import org.mozilla.gecko.util.GeckoBundle;
 import org.mozilla.gecko.util.IntentUtils;
 import org.mozilla.gecko.widget.GeckoPopupMenu;
 
 import java.util.List;
 
@@ -555,14 +556,21 @@ public class CustomTabsActivity extends 
     /* GeckoView.ContentListener */
     @Override
     public void onTitleChange(GeckoView view, String title) {
         mCurrentTitle = title;
         updateActionBar();
     }
 
     @Override
-    public void onFullScreen(GeckoView view, boolean fullScreen) {}
+    public void onFullScreen(GeckoView view, boolean fullScreen) {
+        ActivityUtils.setFullScreen(this, fullScreen);
+        if (fullScreen) {
+            getSupportActionBar().hide();
+        } else {
+            getSupportActionBar().show();
+        }
+    }
 
     @Override
     public void onContextMenu(GeckoView view, int screenX, int screenY,
                               String uri, String elementSrc) {}
 }