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

Unified Diff: ash/shelf/shelf_widget.cc

Issue 13994014: Force refresh of shelf area when gesture completes to prevent (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added test Created 7 years, 8 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 | « ash/shelf/shelf_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_widget.cc
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc
index 755062249c43c6f3b917a8c732246f116379b0a3..e63dfed34455c975806725caba7590a365f6aece 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -277,6 +277,10 @@ class ShelfWidget::DelegateView : public views::WidgetDelegate,
// no dimmer active, the function will return -1.
int GetDimmingAlphaForTest();
+ // A function to test the bounds of the dimming bar. Returns gfx::Rect() if
+ // the dimmer is inactive.
+ gfx::Rect GetDimmerBoundsForTest();
+
// Disable dimming animations for running tests. This needs to be called
// prior to the creation of of the |dimmer_|.
void disable_dimming_animations_for_test() {
@@ -412,6 +416,12 @@ int ShelfWidget::DelegateView::GetDimmingAlphaForTest() {
return -1;
}
+gfx::Rect ShelfWidget::DelegateView::GetDimmerBoundsForTest() {
+ if (GetDimmed())
+ return dimmer_view_->GetBoundsInScreen();
+ return gfx::Rect();
+}
+
void ShelfWidget::DelegateView::UpdateBackground(int alpha) {
alpha_ = alpha;
SchedulePaint();
@@ -555,6 +565,12 @@ int ShelfWidget::GetDimmingAlphaForTest() {
return -1;
}
+gfx::Rect ShelfWidget::GetDimmerBoundsForTest() {
+ if (delegate_view_)
+ return delegate_view_->GetDimmerBoundsForTest();
+ return gfx::Rect();
+}
+
void ShelfWidget::DisableDimmingAnimationsForTest() {
DCHECK(delegate_view_);
return delegate_view_->disable_dimming_animations_for_test();
« no previous file with comments | « ash/shelf/shelf_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698