| 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_->ComputeWorkAreaInsets(root_window, |
| 372 &accessibility_insets); |
| 373 gfx::Insets merged_insets = gfx::Insets( |
| 374 std::max(shelf_insets.top(), accessibility_insets.top()), |
| 375 std::max(shelf_insets.left(), accessibility_insets.left()), |
| 376 std::max(shelf_insets.bottom(), accessibility_insets.bottom()), |
| 377 std::max(shelf_insets.right(), accessibility_insets.right())); |
| 378 |
| 369 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( | 379 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( |
| 370 contains, insets)) { | 380 root_window, merged_insets)) { |
| 371 return; | 381 return; |
| 372 } | 382 } |
| 373 FOR_EACH_OBSERVER(ShellObserver, observers_, | 383 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 384 OnDisplayWorkAreaInsetsChanged()); |
| 385 } |
| 386 |
| 387 void Shell::SetDisplayWorkAreaInsetsForTesting(aura::Window* root_window, |
| 388 const gfx::Insets& insets) { |
| 389 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( |
| 390 root_window, insets)) { |
| 391 return; |
| 392 } |
| 393 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 374 OnDisplayWorkAreaInsetsChanged()); | 394 OnDisplayWorkAreaInsetsChanged()); |
| 375 } | 395 } |
| 376 | 396 |
| 377 void Shell::OnLoginStateChanged(user::LoginStatus status) { | 397 void Shell::OnLoginStateChanged(user::LoginStatus status) { |
| 378 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); | 398 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); |
| 379 } | 399 } |
| 380 | 400 |
| 381 void Shell::OnLoginUserProfilePrepared() { | 401 void Shell::OnLoginUserProfilePrepared() { |
| 382 CreateShelf(); | 402 CreateShelf(); |
| 383 CreateKeyboard(); | 403 CreateKeyboard(); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 | 1189 |
| 1170 void Shell::OnWindowActivated( | 1190 void Shell::OnWindowActivated( |
| 1171 aura::client::ActivationChangeObserver::ActivationReason reason, | 1191 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1172 aura::Window* gained_active, | 1192 aura::Window* gained_active, |
| 1173 aura::Window* lost_active) { | 1193 aura::Window* lost_active) { |
| 1174 if (gained_active) | 1194 if (gained_active) |
| 1175 target_root_window_ = gained_active->GetRootWindow(); | 1195 target_root_window_ = gained_active->GetRootWindow(); |
| 1176 } | 1196 } |
| 1177 | 1197 |
| 1178 } // namespace ash | 1198 } // namespace ash |
| OLD | NEW |