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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/ViewResourceFrameLayout.java

Issue 1221333007: Get rid of ToolbarViewResourceFrameLayout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Start sending ToolbarLayout itself as container 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarViewResourceAdapter.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/widget/ViewResourceFrameLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/ViewResourceFrameLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/ViewResourceFrameLayout.java
index e891d9159f8343a843b9c99c7cfb1b590c845790..4617a35d856d110de3bbc374f9fd71eea150b14b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/ViewResourceFrameLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/ViewResourceFrameLayout.java
@@ -19,6 +19,7 @@ import org.chromium.ui.resources.dynamics.ViewResourceAdapter;
*/
public class ViewResourceFrameLayout extends FrameLayout {
private ViewResourceAdapter mResourceAdapter;
+ private boolean mInitializedForCapture = true;
/**
* Constructs a ViewResourceFrameLayout.
@@ -32,13 +33,6 @@ public class ViewResourceFrameLayout extends FrameLayout {
super(context, attrs);
}
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
-
- mResourceAdapter = createResourceAdapter();
- }
-
/**
* @return A {@link ViewResourceAdapter} instance. This can be overridden for custom behavior.
*/
@@ -50,20 +44,29 @@ public class ViewResourceFrameLayout extends FrameLayout {
* @return The {@link ViewResourceAdapter} that exposes this {@link View} as a CC resource.
*/
public ViewResourceAdapter getResourceAdapter() {
+ if (mResourceAdapter == null) mResourceAdapter = createResourceAdapter();
return mResourceAdapter;
}
/**
- * @return Whether the control container is ready for capturing snapshots.
+ * @return Whether the control container is ready for capturing snapshots. True by default.
+ */
+ protected boolean isInitializedForCapture() {
+ return mInitializedForCapture;
+ }
+
+ /**
+ * Update whether the control container is ready to have the bitmap representation of
+ * itself be captured. This value is true by default.
*/
- protected boolean isReadyForCapture() {
- return true;
+ public void setInitializedForCapture(boolean ready) {
+ mInitializedForCapture = ready;
}
@Override
public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
ViewParent retVal = super.invalidateChildInParent(location, dirty);
- if (isReadyForCapture()) mResourceAdapter.invalidate(dirty);
+ if (isInitializedForCapture()) mResourceAdapter.invalidate(dirty);
return retVal;
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarViewResourceAdapter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698