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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 458 void HandleToggleOverview() { | 458 void HandleToggleOverview() { |
| 459 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); | 459 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); |
| 460 Shell::GetInstance()->window_selector_controller()->ToggleOverview(); | 460 Shell::GetInstance()->window_selector_controller()->ToggleOverview(); |
| 461 } | 461 } |
| 462 | 462 |
| 463 bool CanHandleWindowSnapOrDock() { | 463 bool CanHandleWindowSnapOrDock() { |
| 464 wm::WindowState* window_state = wm::GetActiveWindowState(); | 464 wm::WindowState* window_state = wm::GetActiveWindowState(); |
| 465 // Disable window snapping shortcut key for full screen window due to | 465 // Disable window snapping shortcut key for full screen window due to |
| 466 // http://crbug.com/135487. | 466 // http://crbug.com/135487. |
| 467 return (window_state && | 467 return (window_state && |
| 468 (window_state->window()->type() == ui::wm::WINDOW_TYPE_NORMAL || | 468 wm::IsWindowUserPositionable(window_state->window()) && |
|
oshima
2015/06/04 19:49:11
window_state->IsUserPositionable() ?
bruthig
2015/06/04 19:56:23
Done.
| |
| 469 window_state->window()->type() == ui::wm::WINDOW_TYPE_PANEL) && | |
| 470 !window_state->IsFullscreen()); | 469 !window_state->IsFullscreen()); |
| 471 } | 470 } |
| 472 | 471 |
| 473 void HandleWindowSnapOrDock(AcceleratorAction action) { | 472 void HandleWindowSnapOrDock(AcceleratorAction action) { |
| 474 if (action == WINDOW_CYCLE_SNAP_DOCK_LEFT) | 473 if (action == WINDOW_CYCLE_SNAP_DOCK_LEFT) |
| 475 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); | 474 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); |
| 476 else | 475 else |
| 477 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); | 476 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); |
| 478 | 477 |
| 479 const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_DOCK_LEFT ? | 478 const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_DOCK_LEFT ? |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1330 } | 1329 } |
| 1331 | 1330 |
| 1332 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1331 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
| 1333 scoped_ptr<KeyboardBrightnessControlDelegate> | 1332 scoped_ptr<KeyboardBrightnessControlDelegate> |
| 1334 keyboard_brightness_control_delegate) { | 1333 keyboard_brightness_control_delegate) { |
| 1335 keyboard_brightness_control_delegate_ = | 1334 keyboard_brightness_control_delegate_ = |
| 1336 keyboard_brightness_control_delegate.Pass(); | 1335 keyboard_brightness_control_delegate.Pass(); |
| 1337 } | 1336 } |
| 1338 | 1337 |
| 1339 } // namespace ash | 1338 } // namespace ash |
| OLD | NEW |