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(); |