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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java

Issue 1237913002: [Contextual Search] Adds basic support for narrow Search Panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
index 9ce824e1b9c65962d139d0325fc004579e51e9c9..a741439c35e8f5d4ce85b1d884fc7fb2213a8f3f 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
@@ -10,6 +10,7 @@ import android.content.Intent;
import android.view.ActionMode;
import android.view.KeyEvent;
import android.view.View;
+import android.view.View.MeasureSpec;
import org.chromium.base.Log;
import org.chromium.content.browser.SelectActionModeCallback.ActionHandler;
@@ -30,6 +31,10 @@ public class ContentViewClient {
// Tag used for logging.
private static final String TAG = "cr.ContentViewClient";
+ // Default value to signal that the ContentView's size should not be overridden.
+ private static final int UNSPECIFIED_MEASURE_SPEC =
+ MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
+
public void onUpdateTitle(String title) {
}
@@ -202,4 +207,26 @@ public class ContentViewClient {
}
return true;
}
+
+ /**
+ * ContentViewClient users can return a custom value to override the width of
+ * the ContentView. By default, this method returns MeasureSpec.UNSPECIFIED, which
+ * indicates that the value should not be overridden.
+ *
+ * @return The desired width of the ContentView.
+ */
+ public int getDesiredWidthMeasureSpec() {
+ return UNSPECIFIED_MEASURE_SPEC;
+ }
+
+ /**
+ * ContentViewClient users can return a custom value to override the height of
+ * the ContentView. By default, this method returns MeasureSpec.UNSPECIFIED, which
+ * indicates that the value should not be overridden.
+ *
+ * @return The desired height of the ContentView.
+ */
+ public int getDesiredHeightMeasureSpec() {
+ return UNSPECIFIED_MEASURE_SPEC;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698