Chromium Code Reviews| 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..cb29467b50a8c27c1a8e1ccde19be7a294f14534 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; |
|
David Trainor- moved to gerrit
2015/07/06 20:54:37
Are we sure we want this to default to false? If
Yusuf
2015/07/06 20:58:22
Good catch. We actually want it to default to true
|
| /** |
| * Constructs a ViewResourceFrameLayout. |
| @@ -56,14 +57,22 @@ public class ViewResourceFrameLayout extends FrameLayout { |
| /** |
| * @return Whether the control container is ready for capturing snapshots. |
| */ |
| - protected boolean isReadyForCapture() { |
| - return true; |
| + protected boolean isInitializedForCapture() { |
| + return mInitializedForCapture; |
| + } |
| + |
| + /** |
| + * Update whether the control container is ready to have the bitmap representation of |
| + * itself be captured. |
| + */ |
| + 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; |
| } |
| } |