| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 | 457 |
| 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 && window_state->IsUserPositionable() && |
| 468 (window_state->window()->type() == ui::wm::WINDOW_TYPE_NORMAL || | |
| 469 window_state->window()->type() == ui::wm::WINDOW_TYPE_PANEL) && | |
| 470 !window_state->IsFullscreen()); | 468 !window_state->IsFullscreen()); |
| 471 } | 469 } |
| 472 | 470 |
| 473 void HandleWindowSnapOrDock(AcceleratorAction action) { | 471 void HandleWindowSnapOrDock(AcceleratorAction action) { |
| 474 if (action == WINDOW_CYCLE_SNAP_DOCK_LEFT) | 472 if (action == WINDOW_CYCLE_SNAP_DOCK_LEFT) |
| 475 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); | 473 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); |
| 476 else | 474 else |
| 477 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); | 475 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); |
| 478 | 476 |
| 479 const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_DOCK_LEFT ? | 477 const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_DOCK_LEFT ? |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 } | 1328 } |
| 1331 | 1329 |
| 1332 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1330 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
| 1333 scoped_ptr<KeyboardBrightnessControlDelegate> | 1331 scoped_ptr<KeyboardBrightnessControlDelegate> |
| 1334 keyboard_brightness_control_delegate) { | 1332 keyboard_brightness_control_delegate) { |
| 1335 keyboard_brightness_control_delegate_ = | 1333 keyboard_brightness_control_delegate_ = |
| 1336 keyboard_brightness_control_delegate.Pass(); | 1334 keyboard_brightness_control_delegate.Pass(); |
| 1337 } | 1335 } |
| 1338 | 1336 |
| 1339 } // namespace ash | 1337 } // namespace ash |
| OLD | NEW |