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

Side by Side Diff: ash/wm/window_util.cc

Issue 2162193003: Separates out accelerators using non-common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@accelerators
Patch Set: sim=20 Created 4 years, 5 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
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/window_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/wm/window_util.h" 5 #include "ash/wm/window_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/ash_constants.h" 10 #include "ash/common/ash_constants.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 bool CanActivateWindow(aura::Window* window) { 57 bool CanActivateWindow(aura::Window* window) {
58 return ::wm::CanActivateWindow(window); 58 return ::wm::CanActivateWindow(window);
59 } 59 }
60 60
61 bool IsWindowUserPositionable(aura::Window* window) { 61 bool IsWindowUserPositionable(aura::Window* window) {
62 return GetWindowState(window)->IsUserPositionable(); 62 return GetWindowState(window)->IsUserPositionable();
63 } 63 }
64 64
65 void CenterWindow(aura::Window* window) {
66 wm::WMEvent event(wm::WM_EVENT_CENTER);
67 wm::GetWindowState(window)->OnWMEvent(&event);
68 }
69
70 void PinWindow(aura::Window* window) { 65 void PinWindow(aura::Window* window) {
71 wm::WMEvent event(wm::WM_EVENT_PIN); 66 wm::WMEvent event(wm::WM_EVENT_PIN);
72 wm::GetWindowState(window)->OnWMEvent(&event); 67 wm::GetWindowState(window)->OnWMEvent(&event);
73 } 68 }
74 69
75 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { 70 bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) {
76 views::View* target = static_cast<views::View*>(event.target()); 71 views::View* target = static_cast<views::View*>(event.target());
77 if (!target) 72 if (!target)
78 return false; 73 return false;
79 aura::Window* target_root = 74 aura::Window* target_root =
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (!container->layout_manager()) 111 if (!container->layout_manager())
117 container->SetLayoutManager(new SnapToPixelLayoutManager(container)); 112 container->SetLayoutManager(new SnapToPixelLayoutManager(container));
118 } else { 113 } else {
119 InstallSnapLayoutManagerToContainers(container); 114 InstallSnapLayoutManagerToContainers(container);
120 } 115 }
121 } 116 }
122 } 117 }
123 118
124 } // namespace wm 119 } // namespace wm
125 } // namespace ash 120 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/window_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698