OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.toolbar; | 5 package org.chromium.chrome.browser.toolbar; |
6 | 6 |
7 import android.animation.Animator; | 7 import android.animation.Animator; |
8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
9 import android.animation.AnimatorSet; | 9 import android.animation.AnimatorSet; |
10 import android.animation.ObjectAnimator; | 10 import android.animation.ObjectAnimator; |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 // mClipRect can change in the draw call, so cache this value to ensure
the canvas is | 1110 // mClipRect can change in the draw call, so cache this value to ensure
the canvas is |
1111 // restored correctly. | 1111 // restored correctly. |
1112 boolean shouldClip = !mTextureCaptureMode && mClipRect != null; | 1112 boolean shouldClip = !mTextureCaptureMode && mClipRect != null; |
1113 if (shouldClip) { | 1113 if (shouldClip) { |
1114 canvas.save(); | 1114 canvas.save(); |
1115 canvas.clipRect(mClipRect); | 1115 canvas.clipRect(mClipRect); |
1116 } | 1116 } |
1117 super.draw(canvas); | 1117 super.draw(canvas); |
1118 if (shouldClip) { | 1118 if (shouldClip) { |
1119 canvas.restore(); | 1119 canvas.restore(); |
| 1120 |
| 1121 // Post an invalidate when the clip rect becomes null to ensure anot
her draw pass occurs |
| 1122 // and the full toolbar is drawn again. |
| 1123 if (mClipRect == null) postInvalidate(); |
1120 } | 1124 } |
1121 } | 1125 } |
1122 | 1126 |
1123 @Override | 1127 @Override |
1124 public void onStateRestored() { | 1128 public void onStateRestored() { |
1125 if (mToggleTabStackButton != null) mToggleTabStackButton.setClickable(tr
ue); | 1129 if (mToggleTabStackButton != null) mToggleTabStackButton.setClickable(tr
ue); |
1126 } | 1130 } |
1127 | 1131 |
1128 @Override | 1132 @Override |
1129 public boolean isReadyForTextureCapture() { | 1133 public boolean isReadyForTextureCapture() { |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1914 | 1918 |
1915 getMenuButton().setVisibility(shouldShowMenuButton() ? View.VISIBLE : Vi
ew.GONE); | 1919 getMenuButton().setVisibility(shouldShowMenuButton() ? View.VISIBLE : Vi
ew.GONE); |
1916 } | 1920 } |
1917 | 1921 |
1918 @Override | 1922 @Override |
1919 public LocationBar getLocationBar() { | 1923 public LocationBar getLocationBar() { |
1920 return mPhoneLocationBar; | 1924 return mPhoneLocationBar; |
1921 } | 1925 } |
1922 } | 1926 } |
1923 | 1927 |
OLD | NEW |