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 <string> | 9 #include <string> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "ash/screenshot_delegate.h" | 26 #include "ash/screenshot_delegate.h" |
27 #include "ash/shell.h" | 27 #include "ash/shell.h" |
28 #include "ash/shell_delegate.h" | 28 #include "ash/shell_delegate.h" |
29 #include "ash/shell_window_ids.h" | 29 #include "ash/shell_window_ids.h" |
30 #include "ash/system/brightness/brightness_control_delegate.h" | 30 #include "ash/system/brightness/brightness_control_delegate.h" |
31 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" | 31 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" |
32 #include "ash/system/tray/system_tray.h" | 32 #include "ash/system/tray/system_tray.h" |
33 #include "ash/system/tray/system_tray_delegate.h" | 33 #include "ash/system/tray/system_tray_delegate.h" |
34 #include "ash/volume_control_delegate.h" | 34 #include "ash/volume_control_delegate.h" |
35 #include "ash/wm/partial_screenshot_view.h" | 35 #include "ash/wm/partial_screenshot_view.h" |
36 #include "ash/wm/power_button_controller.h" | |
36 #include "ash/wm/property_util.h" | 37 #include "ash/wm/property_util.h" |
37 #include "ash/wm/window_cycle_controller.h" | 38 #include "ash/wm/window_cycle_controller.h" |
38 #include "ash/wm/window_util.h" | 39 #include "ash/wm/window_util.h" |
39 #include "ash/wm/workspace/snap_sizer.h" | 40 #include "ash/wm/workspace/snap_sizer.h" |
40 #include "base/bind.h" | 41 #include "base/bind.h" |
41 #include "base/command_line.h" | 42 #include "base/command_line.h" |
42 #include "ui/aura/env.h" | 43 #include "ui/aura/env.h" |
43 #include "ui/aura/root_window.h" | 44 #include "ui/aura/root_window.h" |
44 #include "ui/base/accelerators/accelerator.h" | 45 #include "ui/base/accelerators/accelerator.h" |
45 #include "ui/base/accelerators/accelerator_manager.h" | 46 #include "ui/base/accelerators/accelerator_manager.h" |
46 #include "ui/base/events/event.h" | 47 #include "ui/base/events/event.h" |
47 #include "ui/base/keycodes/keyboard_codes.h" | 48 #include "ui/base/keycodes/keyboard_codes.h" |
48 #include "ui/compositor/debug_utils.h" | 49 #include "ui/compositor/debug_utils.h" |
49 #include "ui/compositor/layer.h" | 50 #include "ui/compositor/layer.h" |
50 #include "ui/compositor/layer_animation_sequence.h" | 51 #include "ui/compositor/layer_animation_sequence.h" |
51 #include "ui/compositor/layer_animator.h" | 52 #include "ui/compositor/layer_animator.h" |
52 #include "ui/gfx/screen.h" | 53 #include "ui/gfx/screen.h" |
53 #include "ui/oak/oak.h" | 54 #include "ui/oak/oak.h" |
54 #include "ui/views/debug_utils.h" | 55 #include "ui/views/debug_utils.h" |
55 #include "ui/views/widget/widget.h" | 56 #include "ui/views/widget/widget.h" |
56 | 57 |
57 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
58 #include "ash/display/output_configurator_animation.h" | 59 #include "ash/display/output_configurator_animation.h" |
59 #include "base/chromeos/chromeos_version.h" | 60 #include "base/chromeos/chromeos_version.h" |
61 #include "base/time.h" | |
60 #include "chromeos/display/output_configurator.h" | 62 #include "chromeos/display/output_configurator.h" |
61 #endif // defined(OS_CHROMEOS) | 63 #endif // defined(OS_CHROMEOS) |
62 | 64 |
63 namespace ash { | 65 namespace ash { |
64 namespace { | 66 namespace { |
65 | 67 |
66 // Factor of magnification scale. For example, when this value is 1.189, scale | 68 // Factor of magnification scale. For example, when this value is 1.189, scale |
67 // value will be changed x1.000, x1.189, x1.414, x1.681, x2.000, ... | 69 // value will be changed x1.000, x1.189, x1.414, x1.681, x2.000, ... |
68 // Note: this value is 2.0 ^ (1 / 4). | 70 // Note: this value is 2.0 ^ (1 / 4). |
69 const float kMagnificationFactor = 1.18920712f; | 71 const float kMagnificationFactor = 1.18920712f; |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
754 case MAGNIFY_SCREEN_ZOOM_IN: | 756 case MAGNIFY_SCREEN_ZOOM_IN: |
755 return HandleMagnifyScreen(1); | 757 return HandleMagnifyScreen(1); |
756 case MAGNIFY_SCREEN_ZOOM_OUT: | 758 case MAGNIFY_SCREEN_ZOOM_OUT: |
757 return HandleMagnifyScreen(-1); | 759 return HandleMagnifyScreen(-1); |
758 case MEDIA_NEXT_TRACK: | 760 case MEDIA_NEXT_TRACK: |
759 return HandleMediaNextTrack(); | 761 return HandleMediaNextTrack(); |
760 case MEDIA_PLAY_PAUSE: | 762 case MEDIA_PLAY_PAUSE: |
761 return HandleMediaPlayPause(); | 763 return HandleMediaPlayPause(); |
762 case MEDIA_PREV_TRACK: | 764 case MEDIA_PREV_TRACK: |
763 return HandleMediaPrevTrack(); | 765 return HandleMediaPrevTrack(); |
764 case POWER_PRESSED: // fallthrough | 766 case POWER_PRESSED: |
Daniel Erat
2012/10/06 14:01:20
i think that i'd rather that you made separate LOC
oshima
2012/10/06 17:20:58
I added shutdown as well. I prefer to keep this as
Daniel Erat
2012/10/07 13:40:02
I don't understand the "consistent with the device
| |
765 case POWER_RELEASED: | 767 case POWER_RELEASED: |
766 // We don't do anything with these at present, but we consume them to | 768 // We don't do anything with these at present on the device, but |
767 // prevent them from getting passed to apps -- see | 769 // we consume them to prevent them from getting passed to apps |
768 // http://crbug.com/146609. | 770 // -- see http://crbug.com/146609. |
Daniel Erat
2012/10/06 14:00:19
this comment needs to be updated
oshima
2012/10/06 17:20:58
This was actually updated, but probably not clear
| |
771 #if defined(OS_CHROMEOS) | |
772 if (!base::chromeos::IsRunningOnChromeOS()) { | |
773 Shell::GetInstance()->power_button_controller()-> | |
774 OnLockButtonEvent(action == POWER_PRESSED, base::TimeTicks()); | |
775 } | |
776 #endif | |
769 return true; | 777 return true; |
770 #if !defined(NDEBUG) | 778 #if !defined(NDEBUG) |
771 case PRINT_LAYER_HIERARCHY: | 779 case PRINT_LAYER_HIERARCHY: |
772 return HandlePrintLayerHierarchy(); | 780 return HandlePrintLayerHierarchy(); |
773 case PRINT_VIEW_HIERARCHY: | 781 case PRINT_VIEW_HIERARCHY: |
774 return HandlePrintViewHierarchy(); | 782 return HandlePrintViewHierarchy(); |
775 case PRINT_WINDOW_HIERARCHY: | 783 case PRINT_WINDOW_HIERARCHY: |
776 return HandlePrintWindowHierarchy(); | 784 return HandlePrintWindowHierarchy(); |
777 #endif | 785 #endif |
778 default: | 786 default: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
861 accelerators_.insert( | 869 accelerators_.insert( |
862 std::make_pair(accelerator, accelerators[i].action)); | 870 std::make_pair(accelerator, accelerators[i].action)); |
863 } | 871 } |
864 } | 872 } |
865 | 873 |
866 bool AcceleratorController::CanHandleAccelerators() const { | 874 bool AcceleratorController::CanHandleAccelerators() const { |
867 return true; | 875 return true; |
868 } | 876 } |
869 | 877 |
870 } // namespace ash | 878 } // namespace ash |
OLD | NEW |