Chromium Code Reviews| 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> |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 829 case WINDOW_SNAP_RIGHT: { | 829 case WINDOW_SNAP_RIGHT: { |
| 830 aura::Window* window = wm::GetActiveWindow(); | 830 aura::Window* window = wm::GetActiveWindow(); |
| 831 // Disable window docking shortcut key for full screen window due to | 831 // Disable window docking shortcut key for full screen window due to |
| 832 // http://crbug.com/135487. | 832 // http://crbug.com/135487. |
| 833 if (!window || | 833 if (!window || |
| 834 window->type() != aura::client::WINDOW_TYPE_NORMAL || | 834 window->type() != aura::client::WINDOW_TYPE_NORMAL || |
| 835 wm::IsWindowFullscreen(window)) { | 835 wm::IsWindowFullscreen(window)) { |
| 836 break; | 836 break; |
| 837 } | 837 } |
| 838 | 838 |
| 839 internal::SnapSizer::SnapWindow(window, | 839 using internal::SnapSizer; |
|
varkha
2013/08/30 17:13:25
Is there a reason that ScopedLayerAnimationSetting
pkotwicz
2013/08/30 21:10:57
Good catch!
You are right that we probably should
| |
| 840 action == WINDOW_SNAP_LEFT ? internal::SnapSizer::LEFT_EDGE : | 840 SnapSizer::Edge edge = (action == WINDOW_SNAP_LEFT) ? |
| 841 internal::SnapSizer::RIGHT_EDGE); | 841 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; |
| 842 if (SnapSizer::CanSnapWindow(window, edge)) | |
| 843 SnapSizer::SnapWindow(window, edge, SnapSizer::STEP_YES); | |
| 842 return true; | 844 return true; |
| 843 } | 845 } |
| 844 case WINDOW_MINIMIZE: { | 846 case WINDOW_MINIMIZE: { |
| 845 aura::Window* window = wm::GetActiveWindow(); | 847 aura::Window* window = wm::GetActiveWindow(); |
| 846 // Attempt to restore the window that would be cycled through next from | 848 // Attempt to restore the window that would be cycled through next from |
| 847 // the launcher when there is no active window. | 849 // the launcher when there is no active window. |
| 848 if (!window) | 850 if (!window) |
| 849 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false); | 851 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false); |
| 850 // Disable the shortcut for minimizing full screen window due to | 852 // Disable the shortcut for minimizing full screen window due to |
| 851 // crbug.com/131709, which is a crashing issue related to minimizing | 853 // crbug.com/131709, which is a crashing issue related to minimizing |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 997 keyboard_brightness_control_delegate) { | 999 keyboard_brightness_control_delegate) { |
| 998 keyboard_brightness_control_delegate_ = | 1000 keyboard_brightness_control_delegate_ = |
| 999 keyboard_brightness_control_delegate.Pass(); | 1001 keyboard_brightness_control_delegate.Pass(); |
| 1000 } | 1002 } |
| 1001 | 1003 |
| 1002 bool AcceleratorController::CanHandleAccelerators() const { | 1004 bool AcceleratorController::CanHandleAccelerators() const { |
| 1003 return true; | 1005 return true; |
| 1004 } | 1006 } |
| 1005 | 1007 |
| 1006 } // namespace ash | 1008 } // namespace ash |
| OLD | NEW |