| Index: ash/system/web_notification/ash_popup_alignment_delegate.cc
|
| diff --git a/ash/system/web_notification/ash_popup_alignment_delegate.cc b/ash/system/web_notification/ash_popup_alignment_delegate.cc
|
| index c87c246081b499f730423a275bde0be20c4deeec..05b1e03b412b91c43502b9b6733eb9161e41ac45 100644
|
| --- a/ash/system/web_notification/ash_popup_alignment_delegate.cc
|
| +++ b/ash/system/web_notification/ash_popup_alignment_delegate.cc
|
| @@ -55,7 +55,7 @@ void AshPopupAlignmentDelegate::StartObserving(gfx::Screen* screen,
|
| screen->AddObserver(this);
|
| Shell::GetInstance()->AddShellObserver(this);
|
| if (system_tray_height_ > 0)
|
| - UpdateWorkArea(display, shelf_->auto_hide_state());
|
| + UpdateWorkArea();
|
| }
|
|
|
| void AshPopupAlignmentDelegate::SetSystemTrayHeight(int height) {
|
| @@ -134,39 +134,19 @@ gfx::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const {
|
| shelf_->shelf_widget()->GetNativeView());
|
| }
|
|
|
| -void AshPopupAlignmentDelegate::UpdateWorkArea(const gfx::Display& display,
|
| - ShelfAutoHideState new_state) {
|
| - work_area_ = display.work_area();
|
| - if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) {
|
| - gfx::Rect bounds = ScreenUtil::GetShelfDisplayBoundsInScreen(
|
| - shelf_->shelf_widget()->GetNativeView());
|
| - work_area_.Intersect(bounds);
|
| - }
|
| -
|
| - int width = 0;
|
| - if (shelf_ && (shelf_->visibility_state() == SHELF_AUTO_HIDE) &&
|
| - new_state == SHELF_AUTO_HIDE_SHOWN) {
|
| - // Since the work_area is already reduced by kAutoHideSize, the inset width
|
| - // should be just the difference.
|
| - width = kShelfSize - ShelfLayoutManager::kAutoHideSize;
|
| - }
|
| - work_area_.Inset(shelf_->SelectValueForShelfAlignment(
|
| - gfx::Insets(0, 0, width, 0),
|
| - gfx::Insets(0, width, 0, 0),
|
| - gfx::Insets(0, 0, 0, width),
|
| - gfx::Insets(width, 0, 0, 0)));
|
| -
|
| +void AshPopupAlignmentDelegate::UpdateWorkArea() {
|
| + work_area_ = shelf_->non_shelf_bounds();
|
| DoUpdateIfPossible();
|
| }
|
|
|
| void AshPopupAlignmentDelegate::OnDisplayWorkAreaInsetsChanged() {
|
| UpdateShelf();
|
| - UpdateWorkArea(GetCurrentDisplay(), shelf_->auto_hide_state());
|
| + UpdateWorkArea();
|
| }
|
|
|
| void AshPopupAlignmentDelegate::OnAutoHideStateChanged(
|
| ShelfAutoHideState new_state) {
|
| - UpdateWorkArea(GetCurrentDisplay(), new_state);
|
| + UpdateWorkArea();
|
| }
|
|
|
| void AshPopupAlignmentDelegate::OnDisplayAdded(
|
| @@ -182,7 +162,7 @@ void AshPopupAlignmentDelegate::OnDisplayMetricsChanged(
|
| uint32_t metrics) {
|
| UpdateShelf();
|
| if (shelf_ && GetCurrentDisplay().id() == display.id())
|
| - UpdateWorkArea(display, shelf_->auto_hide_state());
|
| + UpdateWorkArea();
|
| }
|
|
|
| } // namespace ash
|
|
|