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..05ab79c9f0356075fe8c9e79b2f9a9b2ae2ed756 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,25 @@ gfx::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { |
shelf_->shelf_widget()->GetNativeView()); |
} |
-void AshPopupAlignmentDelegate::UpdateWorkArea(const gfx::Display& display, |
- ShelfAutoHideState new_state) { |
- work_area_ = display.work_area(); |
+void AshPopupAlignmentDelegate::UpdateWorkArea() { |
+ work_area_ = shelf_->non_shelf_bounds_in_root(); |
oshima
2015/05/07 19:14:51
can you rename to "non_shelf_bounds_" ?
jonross
2015/05/07 20:58:29
Done.
|
+ |
if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) { |
gfx::Rect bounds = ScreenUtil::GetShelfDisplayBoundsInScreen( |
shelf_->shelf_widget()->GetNativeView()); |
work_area_.Intersect(bounds); |
} |
oshima
2015/05/07 19:14:51
you should no longer need this if block.
jonross
2015/05/07 20:58:29
Done.
|
- |
- 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))); |
- |
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 +168,7 @@ void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( |
uint32_t metrics) { |
UpdateShelf(); |
if (shelf_ && GetCurrentDisplay().id() == display.id()) |
- UpdateWorkArea(display, shelf_->auto_hide_state()); |
+ UpdateWorkArea(); |
} |
} // namespace ash |