Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 23471004: Only support left/right maximizing at 50% width when the --ash-enable-alternate-caption-button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 29 matching lines...) Expand all
40 #include "ash/system/tray/system_tray_notifier.h" 40 #include "ash/system/tray/system_tray_notifier.h"
41 #include "ash/system/web_notification/web_notification_tray.h" 41 #include "ash/system/web_notification/web_notification_tray.h"
42 #include "ash/touch/touch_hud_debug.h" 42 #include "ash/touch/touch_hud_debug.h"
43 #include "ash/volume_control_delegate.h" 43 #include "ash/volume_control_delegate.h"
44 #include "ash/wm/overview/window_selector_controller.h" 44 #include "ash/wm/overview/window_selector_controller.h"
45 #include "ash/wm/partial_screenshot_view.h" 45 #include "ash/wm/partial_screenshot_view.h"
46 #include "ash/wm/power_button_controller.h" 46 #include "ash/wm/power_button_controller.h"
47 #include "ash/wm/property_util.h" 47 #include "ash/wm/property_util.h"
48 #include "ash/wm/window_cycle_controller.h" 48 #include "ash/wm/window_cycle_controller.h"
49 #include "ash/wm/window_util.h" 49 #include "ash/wm/window_util.h"
50 #include "ash/wm/workspace/snap_sizer.h"
51 #include "base/bind.h" 50 #include "base/bind.h"
52 #include "base/command_line.h" 51 #include "base/command_line.h"
53 #include "content/public/browser/gpu_data_manager.h" 52 #include "content/public/browser/gpu_data_manager.h"
54 #include "ui/aura/env.h" 53 #include "ui/aura/env.h"
55 #include "ui/aura/root_window.h" 54 #include "ui/aura/root_window.h"
56 #include "ui/base/accelerators/accelerator.h" 55 #include "ui/base/accelerators/accelerator.h"
57 #include "ui/base/accelerators/accelerator_manager.h" 56 #include "ui/base/accelerators/accelerator_manager.h"
58 #include "ui/base/events/event.h" 57 #include "ui/base/events/event.h"
59 #include "ui/base/keycodes/keyboard_codes.h" 58 #include "ui/base/keycodes/keyboard_codes.h"
60 #include "ui/compositor/debug_utils.h" 59 #include "ui/compositor/debug_utils.h"
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 case WINDOW_SNAP_RIGHT: { 828 case WINDOW_SNAP_RIGHT: {
830 aura::Window* window = wm::GetActiveWindow(); 829 aura::Window* window = wm::GetActiveWindow();
831 // Disable window docking shortcut key for full screen window due to 830 // Disable window docking shortcut key for full screen window due to
832 // http://crbug.com/135487. 831 // http://crbug.com/135487.
833 if (!window || 832 if (!window ||
834 window->type() != aura::client::WINDOW_TYPE_NORMAL || 833 window->type() != aura::client::WINDOW_TYPE_NORMAL ||
835 wm::IsWindowFullscreen(window)) { 834 wm::IsWindowFullscreen(window)) {
836 break; 835 break;
837 } 836 }
838 837
839 internal::SnapSizer::SnapWindow(window, 838 if (wm::CanSnapWindow(window)) {
840 action == WINDOW_SNAP_LEFT ? internal::SnapSizer::LEFT_EDGE : 839 wm::SnapWindowToEdge(window,
841 internal::SnapSizer::RIGHT_EDGE); 840 action == WINDOW_SNAP_LEFT ? wm::SNAP_LEFT_EDGE :
841 wm::SNAP_RIGHT_EDGE);
842 }
842 return true; 843 return true;
843 } 844 }
844 case WINDOW_MINIMIZE: { 845 case WINDOW_MINIMIZE: {
845 aura::Window* window = wm::GetActiveWindow(); 846 aura::Window* window = wm::GetActiveWindow();
846 // Attempt to restore the window that would be cycled through next from 847 // Attempt to restore the window that would be cycled through next from
847 // the launcher when there is no active window. 848 // the launcher when there is no active window.
848 if (!window) 849 if (!window)
849 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false); 850 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false);
850 // Disable the shortcut for minimizing full screen window due to 851 // Disable the shortcut for minimizing full screen window due to
851 // crbug.com/131709, which is a crashing issue related to minimizing 852 // crbug.com/131709, which is a crashing issue related to minimizing
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 keyboard_brightness_control_delegate) { 998 keyboard_brightness_control_delegate) {
998 keyboard_brightness_control_delegate_ = 999 keyboard_brightness_control_delegate_ =
999 keyboard_brightness_control_delegate.Pass(); 1000 keyboard_brightness_control_delegate.Pass();
1000 } 1001 }
1001 1002
1002 bool AcceleratorController::CanHandleAccelerators() const { 1003 bool AcceleratorController::CanHandleAccelerators() const {
1003 return true; 1004 return true;
1004 } 1005 }
1005 1006
1006 } // namespace ash 1007 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698