Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index 27697f67abd5ab06eff3c729590e24018f245b5a..599a09d81d5d080da35a5175bf06c7b82eb162be 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -364,10 +364,30 @@ void Shell::RotateFocus(Direction direction) { |
: FocusCycler::BACKWARD); |
} |
-void Shell::SetDisplayWorkAreaInsets(Window* contains, |
- const gfx::Insets& insets) { |
+void Shell::UpdateDisplayWorkAreaInsets(Window* root_window) { |
+ gfx::Insets shelf_insets = |
+ ash::ShelfLayoutManager::ForShelf(root_window)->GetWorkAreaInsets(); |
+ gfx::Insets accessibility_insets; |
+ accessibility_delegate_->ComputeWorkAreaInsets(root_window, |
+ &accessibility_insets); |
+ gfx::Insets merged_insets = gfx::Insets( |
+ std::max(shelf_insets.top(), accessibility_insets.top()), |
+ std::max(shelf_insets.left(), accessibility_insets.left()), |
+ std::max(shelf_insets.bottom(), accessibility_insets.bottom()), |
+ std::max(shelf_insets.right(), accessibility_insets.right())); |
+ |
+ if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( |
+ root_window, merged_insets)) { |
+ return; |
+ } |
+ FOR_EACH_OBSERVER(ShellObserver, observers_, |
+ OnDisplayWorkAreaInsetsChanged()); |
+} |
+ |
+void Shell::SetDisplayWorkAreaInsetsForTesting(aura::Window* root_window, |
+ const gfx::Insets& insets) { |
if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( |
- contains, insets)) { |
+ root_window, insets)) { |
return; |
} |
FOR_EACH_OBSERVER(ShellObserver, observers_, |