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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <iostream> | 9 #include <iostream> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "ash/accelerators/accelerator_commands.h" | 12 #include "ash/accelerators/accelerator_commands.h" |
13 #include "ash/accelerators/accelerator_table.h" | 13 #include "ash/accelerators/accelerator_table.h" |
14 #include "ash/accelerators/debug_commands.h" | 14 #include "ash/accelerators/debug_commands.h" |
15 #include "ash/ash_switches.h" | 15 #include "ash/ash_switches.h" |
16 #include "ash/debug.h" | 16 #include "ash/debug.h" |
17 #include "ash/display/display_controller.h" | 17 #include "ash/display/display_controller.h" |
18 #include "ash/display/display_manager.h" | 18 #include "ash/display/display_manager.h" |
19 #include "ash/focus_cycler.h" | 19 #include "ash/focus_cycler.h" |
20 #include "ash/gpu_support.h" | 20 #include "ash/gpu_support.h" |
| 21 #include "ash/host/ash_window_tree_host.h" |
21 #include "ash/ime_control_delegate.h" | 22 #include "ash/ime_control_delegate.h" |
22 #include "ash/magnifier/magnification_controller.h" | 23 #include "ash/magnifier/magnification_controller.h" |
23 #include "ash/magnifier/partial_magnification_controller.h" | 24 #include "ash/magnifier/partial_magnification_controller.h" |
24 #include "ash/media_delegate.h" | 25 #include "ash/media_delegate.h" |
25 #include "ash/multi_profile_uma.h" | 26 #include "ash/multi_profile_uma.h" |
26 #include "ash/new_window_delegate.h" | 27 #include "ash/new_window_delegate.h" |
27 #include "ash/root_window_controller.h" | 28 #include "ash/root_window_controller.h" |
28 #include "ash/rotator/screen_rotation.h" | 29 #include "ash/rotator/screen_rotation.h" |
29 #include "ash/screenshot_delegate.h" | 30 #include "ash/screenshot_delegate.h" |
30 #include "ash/session_state_delegate.h" | 31 #include "ash/session_state_delegate.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 492 |
492 bool HandleToggleFullscreen(ui::KeyboardCode key_code) { | 493 bool HandleToggleFullscreen(ui::KeyboardCode key_code) { |
493 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) { | 494 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) { |
494 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); | 495 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); |
495 } | 496 } |
496 accelerators::ToggleFullscreen(); | 497 accelerators::ToggleFullscreen(); |
497 return true; | 498 return true; |
498 } | 499 } |
499 | 500 |
500 bool HandleToggleRootWindowFullScreen() { | 501 bool HandleToggleRootWindowFullScreen() { |
501 Shell::GetPrimaryRootWindow()->GetHost()->ToggleFullScreen(); | 502 Shell::GetPrimaryRootWindowController()->ash_host()->ToggleFullScreen(); |
502 return true; | 503 return true; |
503 } | 504 } |
504 | 505 |
505 bool HandleWindowSnap(int action) { | 506 bool HandleWindowSnap(int action) { |
506 wm::WindowState* window_state = wm::GetActiveWindowState(); | 507 wm::WindowState* window_state = wm::GetActiveWindowState(); |
507 // Disable window snapping shortcut key for full screen window due to | 508 // Disable window snapping shortcut key for full screen window due to |
508 // http://crbug.com/135487. | 509 // http://crbug.com/135487. |
509 if (!window_state || | 510 if (!window_state || |
510 window_state->window()->type() != ui::wm::WINDOW_TYPE_NORMAL || | 511 window_state->window()->type() != ui::wm::WINDOW_TYPE_NORMAL || |
511 window_state->IsFullscreen()) { | 512 window_state->IsFullscreen()) { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 for (size_t i = 0; i < window->children().size(); ++i) | 719 for (size_t i = 0; i < window->children().size(); ++i) |
719 PrintWindowHierarchy(window->children()[i], indent + 3, out); | 720 PrintWindowHierarchy(window->children()[i], indent + 3, out); |
720 } | 721 } |
721 | 722 |
722 bool HandlePrintWindowHierarchy() { | 723 bool HandlePrintWindowHierarchy() { |
723 Shell::RootWindowControllerList controllers = | 724 Shell::RootWindowControllerList controllers = |
724 Shell::GetAllRootWindowControllers(); | 725 Shell::GetAllRootWindowControllers(); |
725 for (size_t i = 0; i < controllers.size(); ++i) { | 726 for (size_t i = 0; i < controllers.size(); ++i) { |
726 std::ostringstream out; | 727 std::ostringstream out; |
727 out << "RootWindow " << i << ":\n"; | 728 out << "RootWindow " << i << ":\n"; |
728 PrintWindowHierarchy(controllers[i]->root_window(), 0, &out); | 729 PrintWindowHierarchy(controllers[i]->GetRootWindow(), 0, &out); |
729 // Error so logs can be collected from end-users. | 730 // Error so logs can be collected from end-users. |
730 LOG(ERROR) << out.str(); | 731 LOG(ERROR) << out.str(); |
731 } | 732 } |
732 return true; | 733 return true; |
733 } | 734 } |
734 | 735 |
735 bool HandlePrintUIHierarchies() { | 736 bool HandlePrintUIHierarchies() { |
736 // This is a separate command so the user only has to hit one key to generate | 737 // This is a separate command so the user only has to hit one key to generate |
737 // all the logs. Developers use the individual dumps repeatedly, so keep | 738 // all the logs. Developers use the individual dumps repeatedly, so keep |
738 // those as separate commands to avoid spamming their logs. | 739 // those as separate commands to avoid spamming their logs. |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 keyboard_brightness_control_delegate) { | 1184 keyboard_brightness_control_delegate) { |
1184 keyboard_brightness_control_delegate_ = | 1185 keyboard_brightness_control_delegate_ = |
1185 keyboard_brightness_control_delegate.Pass(); | 1186 keyboard_brightness_control_delegate.Pass(); |
1186 } | 1187 } |
1187 | 1188 |
1188 bool AcceleratorController::CanHandleAccelerators() const { | 1189 bool AcceleratorController::CanHandleAccelerators() const { |
1189 return true; | 1190 return true; |
1190 } | 1191 } |
1191 | 1192 |
1192 } // namespace ash | 1193 } // namespace ash |
OLD | NEW |