OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 views::Widget* widget) { | 357 views::Widget* widget) { |
358 // Use translucent-style window frames for dialogs. | 358 // Use translucent-style window frames for dialogs. |
359 return new CustomFrameViewAsh(widget); | 359 return new CustomFrameViewAsh(widget); |
360 } | 360 } |
361 | 361 |
362 void Shell::RotateFocus(Direction direction) { | 362 void Shell::RotateFocus(Direction direction) { |
363 focus_cycler_->RotateFocus(direction == FORWARD ? FocusCycler::FORWARD | 363 focus_cycler_->RotateFocus(direction == FORWARD ? FocusCycler::FORWARD |
364 : FocusCycler::BACKWARD); | 364 : FocusCycler::BACKWARD); |
365 } | 365 } |
366 | 366 |
367 void Shell::SetDisplayWorkAreaInsets(Window* contains, | 367 void Shell::UpdateDisplayWorkAreaInsets(Window* root_window) { |
368 const gfx::Insets& insets) { | 368 gfx::Insets shelf_insets = |
| 369 ash::ShelfLayoutManager::ForShelf(root_window)->GetWorkAreaInsets(); |
| 370 gfx::Insets accessibility_insets = |
| 371 accessibility_delegate_->GetWorkAreaInsets(root_window); |
| 372 gfx::Insets merged_insets = gfx::Insets( |
| 373 std::max(shelf_insets.top(), accessibility_insets.top()), |
| 374 std::max(shelf_insets.left(), accessibility_insets.left()), |
| 375 std::max(shelf_insets.bottom(), accessibility_insets.bottom()), |
| 376 std::max(shelf_insets.right(), accessibility_insets.right())); |
| 377 |
369 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( | 378 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( |
370 contains, insets)) { | 379 root_window, merged_insets)) { |
371 return; | 380 return; |
372 } | 381 } |
373 FOR_EACH_OBSERVER(ShellObserver, observers_, | 382 FOR_EACH_OBSERVER(ShellObserver, observers_, |
374 OnDisplayWorkAreaInsetsChanged()); | 383 OnDisplayWorkAreaInsetsChanged()); |
375 } | 384 } |
376 | 385 |
377 void Shell::OnLoginStateChanged(user::LoginStatus status) { | 386 void Shell::OnLoginStateChanged(user::LoginStatus status) { |
378 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); | 387 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); |
379 } | 388 } |
380 | 389 |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 | 1178 |
1170 void Shell::OnWindowActivated( | 1179 void Shell::OnWindowActivated( |
1171 aura::client::ActivationChangeObserver::ActivationReason reason, | 1180 aura::client::ActivationChangeObserver::ActivationReason reason, |
1172 aura::Window* gained_active, | 1181 aura::Window* gained_active, |
1173 aura::Window* lost_active) { | 1182 aura::Window* lost_active) { |
1174 if (gained_active) | 1183 if (gained_active) |
1175 target_root_window_ = gained_active->GetRootWindow(); | 1184 target_root_window_ = gained_active->GetRootWindow(); |
1176 } | 1185 } |
1177 | 1186 |
1178 } // namespace ash | 1187 } // namespace ash |
OLD | NEW |