Bug 1381983 - [2.1] Add default/stub implementations of the context menu handlers. r=snorp
authorEugen Sawin <esawin@mozilla.com>
Tue, 18 Jul 2017 22:19:27 +0200
changeset 421980 21a44de78be3996c6a8599d086888751666afa75
parent 421979 60f7e2cb890c80d38cb254aa8e7a08caf079e46d
child 421981 e00f60085ca6ddd86acee9757c582baf57232807
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1381983
milestone56.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 1381983 - [2.1] Add default/stub implementations of the context menu handlers. r=snorp
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -3452,16 +3452,20 @@ public class BrowserApp extends GeckoApp
             mDynamicToolbar.setPinned(true, PinReason.FULL_SCREEN);
         } else {
             mDynamicToolbar.setPinned(false, PinReason.FULL_SCREEN);
             mDynamicToolbar.setVisible(true, VisibilityTransition.IMMEDIATE);
         }
     }
 
     @Override
+    public void onContextMenu(GeckoView view, int screenX, int screenY,
+                              String uri, String imageSrc) {}
+
+    @Override
     public boolean onPrepareOptionsMenu(Menu aMenu) {
         if (aMenu == null)
             return false;
 
         // Hide the tab history panel when hardware menu button is pressed.
         TabHistoryFragment frag = (TabHistoryFragment) getSupportFragmentManager().findFragmentByTag(TAB_HISTORY_FRAGMENT_TAG);
         if (frag != null) {
             frag.dismiss();
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -562,9 +562,13 @@ public class CustomTabsActivity extends 
     @Override
     public void onTitleChange(GeckoView view, String title) {
         mCurrentTitle = title;
         updateActionBar();
     }
 
     @Override
     public void onFullScreen(GeckoView view, boolean fullScreen) {}
+
+    @Override
+    public void onContextMenu(GeckoView view, int screenX, int screenY,
+                              String uri, String imageSrc) {}
 }
--- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
+++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
@@ -128,16 +128,24 @@ public class GeckoViewActivity extends A
             getWindow().setFlags(fullScreen ? WindowManager.LayoutParams.FLAG_FULLSCREEN : 0,
                                  WindowManager.LayoutParams.FLAG_FULLSCREEN);
             if (fullScreen) {
                 getActionBar().hide();
             } else {
                 getActionBar().show();
             }
         }
+
+        @Override
+        public void onContextMenu(GeckoView view, int screenX, int screenY,
+                                  String uri, String imageSrc) {
+            Log.d(LOGTAG, "onContextMenu screenX=" + screenX +
+                          " screenY=" + screenY + " uri=" + uri +
+                          " imageSrc=" + imageSrc);
+        }
     }
 
     private class MyGeckoViewProgress implements GeckoView.ProgressListener {
         @Override
         public void onPageStart(GeckoView view, String url) {
             Log.i(LOGTAG, "Starting to load page at " + url);
             Log.i(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() +
                   " - page load start");