Index: ash/shelf/shelf_layout_manager.cc |
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
index 5e1aab01e84749a9e1ec42bf9fab99df80031511..b48d5f7cfc48471ccfb74e89b16c9884cdac66f5 100644 |
--- a/ash/shelf/shelf_layout_manager.cc |
+++ b/ash/shelf/shelf_layout_manager.cc |
@@ -541,6 +541,10 @@ bool ShelfLayoutManager::IsHorizontalAlignment() const { |
GetAlignment() == SHELF_ALIGNMENT_TOP; |
} |
+gfx::Insets ShelfLayoutManager::GetWorkAreaInsets() const { |
+ return work_area_insets_; |
+} |
+ |
// static |
ShelfLayoutManager* ShelfLayoutManager::ForShelf(aura::Window* window) { |
ShelfWidget* shelf = RootWindowController::ForShelf(window)->shelf(); |
@@ -704,14 +708,15 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity( |
shelf_->status_area_widget()->GetNativeView()->parent(), |
status_bounds)); |
if (!state_.is_screen_locked) { |
- gfx::Insets insets; |
// If user session is blocked (login to new user session or add user to |
// the existing session - multi-profile) then give 100% of work area only |
// if keyboard is not shown. |
if (!state_.is_adding_user_screen || !keyboard_bounds_.IsEmpty()) { |
- insets = target_bounds.work_area_insets; |
+ work_area_insets_ = target_bounds.work_area_insets; |
+ } else { |
+ work_area_insets_ = gfx::Insets(); |
} |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root_window_, insets); |
+ Shell::GetInstance()->UpdateDisplayWorkAreaInsets(root_window_); |
} |
} |
@@ -1131,7 +1136,8 @@ void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { |
// window. |
if (session_state_delegate->IsUserSessionBlocked() && |
keyboard_is_about_to_hide) { |
- Shell::GetInstance()->SetDisplayWorkAreaInsets(root_window_, gfx::Insets()); |
+ work_area_insets_ = gfx::Insets(); |
+ Shell::GetInstance()->UpdateDisplayWorkAreaInsets(root_window_); |
} |
} |