Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java

Issue 2682593002: Refactor ContentViewClient (4/6) (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java
diff --git a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java b/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java
index 9a9d89beedcbc99147bb2ac2c28e1db5d6181a1a..2ebd7412f494e66cab12e5eb3074d3863a673e3e 100644
--- a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java
+++ b/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java
@@ -25,6 +25,10 @@ public abstract class ViewAndroidDelegate {
// TODO(hush): use View#DRAG_FLAG_GLOBAL when Chromium starts to build with API 24.
private static final int DRAG_FLAG_GLOBAL = 1 << 8;
+ private static final String GEO_SCHEME = "geo";
+ private static final String TEL_SCHEME = "tel";
+ private static final String MAILTO_SCHEME = "mailto";
+
/**
* @return An anchor view that can be used to anchor decoration views like Autofill popup.
*/
@@ -105,6 +109,46 @@ public abstract class ViewAndroidDelegate {
}
/**
+ * Called whenever the background color of the page changes as notified by WebKit.
boliu 2017/02/07 21:47:06 blink :p
Jinsuk Kim 2017/02/07 23:51:04 Done.
+ * @param color The new ARGB color of the page background.
+ */
+ @CalledByNative
+ public void onBackgroundColorChanged(int color) {}
+
+ /**
+ * Notifies the client of the position of the top controls.
+ * @param topControlsOffsetY The Y offset of the top controls in physical pixels.
+ * @param topContentOffsetY The Y offset of the content in physical pixels.
+ */
+ @CalledByNative
+ public void onTopControlsChanged(float topControlsOffsetY, float topContentOffsetY) {}
+
+ /**
+ * Notifies the client of the position of the bottom controls.
+ * @param bottomControlsOffsetY The Y offset of the bottom controls in physical pixels.
+ * @param bottomContentOffsetY The Y offset of the content in physical pixels.
+ */
+ @CalledByNative
+ public void onBottomControlsChanged(float bottomControlsOffsetY, float bottomContentOffsetY) {}
+
+ /**
+ * Check whether the given scheme is one of the acceptable schemes for onStartContentIntent.
+ *
+ * @param scheme The scheme to check.
+ * @return true if the scheme is okay, false if it should be blocked.
+ */
+ protected static boolean isAcceptableContentIntentScheme(String scheme) {
boliu 2017/02/07 21:47:06 you can do a step further here to reduce code dupl
Jinsuk Kim 2017/02/07 23:51:04 Good point. Done.
+ return GEO_SCHEME.equals(scheme) || TEL_SCHEME.equals(scheme)
+ || MAILTO_SCHEME.equals(scheme);
+ }
+
+ /**
+ * Called when a new content intent is requested to be started.
+ */
+ @CalledByNative
+ public void onStartContentIntent(String intentUrl, boolean isMainFrame) {}
+
+ /**
* @return container view that the anchor views are added to. May be null.
*/
@CalledByNative

Powered by Google App Engine
This is Rietveld 408576698