Bug 1321638 - Part 2: Remove fullscreen support for GeckoView consumers. r=jchen
As implemented right now, this doesn't make sense for general
GeckoView consumers.
I believe fullscreen will be important to GeckoView consumers -- games
in particular will want it -- but we'll need to think harder about how
to support it, how to support it with multiple GeckoViews, and how to
ensure we persist the fullscreen state across device configuration
changes, etc.
MozReview-Commit-ID: 5sjNx1hovvt
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
@@ -1,24 +1,19 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* 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/. */
package org.mozilla.gecko;
-import org.mozilla.gecko.util.ActivityUtils;
import org.mozilla.gecko.util.HardwareUtils;
-import org.mozilla.gecko.util.ThreadUtils;
import android.app.Activity;
import android.content.Context;
-import android.graphics.RectF;
-import android.hardware.SensorEventListener;
-import android.location.LocationListener;
import android.view.View;
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
@@ -59,22 +54,17 @@ public class BaseGeckoInterface implemen
}
// Bug 908775: Implement this
@Override
public void doRestart() {}
@Override
public void setFullScreen(final boolean fullscreen) {
- ThreadUtils.postToUiThread(new Runnable() {
- @Override
- public void run() {
- ActivityUtils.setFullScreen(getActivity(), fullscreen);
- }
- });
+ // This API doesn't make sense for GeckoView, so we do nothing for now.
}
// Bug 908779: Implement this
@Override
public void addPluginView(final View view) {}
// Bug 908781: Implement this
@Override
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -1722,16 +1722,22 @@ public class GeckoAppShell
}
public interface GeckoInterface {
public EventDispatcher getAppEventDispatcher();
public GeckoProfile getProfile();
public Activity getActivity();
public String getDefaultUAString();
public void doRestart();
+
+ /**
+ * This API doesn't make sense for arbitrary GeckoView consumers. In future, consider an
+ * API like Android WebView's, which provides a View to the consumer to display fullscreen.
+ * See <a href="https://developer.android.com/reference/android/webkit/WebChromeClient.html#onShowCustomView(android.view.View,%20android.webkit.WebChromeClient.CustomViewCallback)">https://developer.android.com/reference/android/webkit/WebChromeClient.html#onShowCustomView(android.view.View,%20android.webkit.WebChromeClient.CustomViewCallback)</a>.
+ */
public void setFullScreen(boolean fullscreen);
public void addPluginView(View view);
public void removePluginView(final View view);
public void enableOrientationListener();
public void disableOrientationListener();
public void addAppStateListener(AppStateListener listener);
public void removeAppStateListener(AppStateListener listener);
public void notifyWakeLockChanged(String topic, String state);