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 17 matching lines...) Expand all Loading... |
28 #include "ash/shell_window_ids.h" | 28 #include "ash/shell_window_ids.h" |
29 #include "ash/system/brightness/brightness_control_delegate.h" | 29 #include "ash/system/brightness/brightness_control_delegate.h" |
30 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" | 30 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" |
31 #include "ash/system/tray/system_tray.h" | 31 #include "ash/system/tray/system_tray.h" |
32 #include "ash/volume_control_delegate.h" | 32 #include "ash/volume_control_delegate.h" |
33 #include "ash/wm/partial_screenshot_view.h" | 33 #include "ash/wm/partial_screenshot_view.h" |
34 #include "ash/wm/property_util.h" | 34 #include "ash/wm/property_util.h" |
35 #include "ash/wm/window_cycle_controller.h" | 35 #include "ash/wm/window_cycle_controller.h" |
36 #include "ash/wm/window_util.h" | 36 #include "ash/wm/window_util.h" |
37 #include "ash/wm/workspace/snap_sizer.h" | 37 #include "ash/wm/workspace/snap_sizer.h" |
| 38 #include "base/bind.h" |
38 #include "base/command_line.h" | 39 #include "base/command_line.h" |
39 #include "ui/aura/event.h" | 40 #include "ui/aura/event.h" |
40 #include "ui/aura/root_window.h" | 41 #include "ui/aura/root_window.h" |
41 #include "ui/base/accelerators/accelerator.h" | 42 #include "ui/base/accelerators/accelerator.h" |
42 #include "ui/base/accelerators/accelerator_manager.h" | 43 #include "ui/base/accelerators/accelerator_manager.h" |
43 #include "ui/base/keycodes/keyboard_codes.h" | 44 #include "ui/base/keycodes/keyboard_codes.h" |
44 #include "ui/compositor/debug_utils.h" | 45 #include "ui/compositor/debug_utils.h" |
45 #include "ui/compositor/layer.h" | 46 #include "ui/compositor/layer.h" |
46 #include "ui/compositor/layer_animation_sequence.h" | 47 #include "ui/compositor/layer_animation_sequence.h" |
47 #include "ui/compositor/layer_animator.h" | 48 #include "ui/compositor/layer_animator.h" |
48 #include "ui/oak/oak.h" | 49 #include "ui/oak/oak.h" |
49 #include "ui/views/debug_utils.h" | 50 #include "ui/views/debug_utils.h" |
50 #include "ui/views/widget/widget.h" | 51 #include "ui/views/widget/widget.h" |
51 | 52 |
52 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
| 54 #include "ash/display/output_configurator_animation.h" |
53 #include "chromeos/display/output_configurator.h" | 55 #include "chromeos/display/output_configurator.h" |
54 #endif // defined(OS_CHROMEOS) | 56 #endif // defined(OS_CHROMEOS) |
55 | 57 |
56 namespace ash { | 58 namespace ash { |
57 namespace { | 59 namespace { |
58 | 60 |
59 // Factor of magnification scale. For example, when this value is 1.189, scale | 61 // Factor of magnification scale. For example, when this value is 1.189, scale |
60 // value will be changed x1.000, x1.189, x1.414, x1.681, x2.000, ... | 62 // value will be changed x1.000, x1.189, x1.414, x1.681, x2.000, ... |
61 // Note: this value is 2.0 ^ (1 / 4). | 63 // Note: this value is 2.0 ^ (1 / 4). |
62 const float kMagnificationFactor = 1.18920712f; | 64 const float kMagnificationFactor = 1.18920712f; |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 case LOCK_SCREEN: | 401 case LOCK_SCREEN: |
400 return HandleLock(); | 402 return HandleLock(); |
401 case OPEN_FILE_MANAGER_DIALOG: | 403 case OPEN_FILE_MANAGER_DIALOG: |
402 return HandleFileManager(true /* as_dialog */); | 404 return HandleFileManager(true /* as_dialog */); |
403 case OPEN_FILE_MANAGER_TAB: | 405 case OPEN_FILE_MANAGER_TAB: |
404 return HandleFileManager(false /* as_dialog */); | 406 return HandleFileManager(false /* as_dialog */); |
405 case OPEN_CROSH: | 407 case OPEN_CROSH: |
406 return HandleCrosh(); | 408 return HandleCrosh(); |
407 case TOGGLE_SPOKEN_FEEDBACK: | 409 case TOGGLE_SPOKEN_FEEDBACK: |
408 return HandleToggleSpokenFeedback(); | 410 return HandleToggleSpokenFeedback(); |
409 case CYCLE_DISPLAY_MODE: | 411 case CYCLE_DISPLAY_MODE: { |
410 ash::Shell::GetInstance()->output_configurator()->CycleDisplayMode(); | 412 internal::OutputConfiguratorAnimation* animation = |
| 413 Shell::GetInstance()->output_configurator_animation(); |
| 414 animation->StartFadeOutAnimation(base::Bind( |
| 415 base::IgnoreResult(&chromeos::OutputConfigurator::CycleDisplayMode), |
| 416 base::Unretained(Shell::GetInstance()->output_configurator()))); |
411 return true; | 417 return true; |
| 418 } |
412 #endif | 419 #endif |
413 case OPEN_FEEDBACK_PAGE: | 420 case OPEN_FEEDBACK_PAGE: |
414 ash::Shell::GetInstance()->delegate()->OpenFeedbackPage(); | 421 ash::Shell::GetInstance()->delegate()->OpenFeedbackPage(); |
415 return true; | 422 return true; |
416 case EXIT: | 423 case EXIT: |
417 return HandleExit(); | 424 return HandleExit(); |
418 case NEW_INCOGNITO_WINDOW: | 425 case NEW_INCOGNITO_WINDOW: |
419 return HandleNewWindow(true /* is_incognito */); | 426 return HandleNewWindow(true /* is_incognito */); |
420 case NEW_TAB: | 427 case NEW_TAB: |
421 if (key_code == ui::VKEY_T && shell->delegate()) | 428 if (key_code == ui::VKEY_T && shell->delegate()) |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 accelerators_.insert( | 741 accelerators_.insert( |
735 std::make_pair(accelerator, accelerators[i].action)); | 742 std::make_pair(accelerator, accelerators[i].action)); |
736 } | 743 } |
737 } | 744 } |
738 | 745 |
739 bool AcceleratorController::CanHandleAccelerators() const { | 746 bool AcceleratorController::CanHandleAccelerators() const { |
740 return true; | 747 return true; |
741 } | 748 } |
742 | 749 |
743 } // namespace ash | 750 } // namespace ash |
OLD | NEW |