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

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

Issue 2787363002: Moves couple of WmShell methods to standalone functions (Closed)
Patch Set: feedback and fix applist Created 3 years, 8 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
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/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
11 #include "ash/common/wm/window_state.h" 11 #include "ash/common/wm/window_state.h"
12 #include "ash/common/wm/wm_event.h" 12 #include "ash/common/wm/wm_event.h"
13 #include "ash/common/wm/wm_screen_util.h" 13 #include "ash/common/wm/wm_screen_util.h"
14 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
15 #include "ash/common/wm_window.h" 15 #include "ash/common/wm_window.h"
16 #include "ash/root_window_controller.h" 16 #include "ash/root_window_controller.h"
17 #include "ash/shell.h" 17 #include "ash/shell.h"
18 #include "ash/wm/window_properties.h" 18 #include "ash/wm/window_properties.h"
19 #include "ash/wm/window_state_aura.h" 19 #include "ash/wm/window_state_aura.h"
20 #include "ui/aura/client/aura_constants.h" 20 #include "ui/aura/client/aura_constants.h"
21 #include "ui/aura/client/capture_client.h"
22 #include "ui/aura/client/focus_client.h"
21 #include "ui/aura/window.h" 23 #include "ui/aura/window.h"
22 #include "ui/aura/window_delegate.h" 24 #include "ui/aura/window_delegate.h"
23 #include "ui/aura/window_event_dispatcher.h" 25 #include "ui/aura/window_event_dispatcher.h"
24 #include "ui/compositor/dip_util.h" 26 #include "ui/compositor/dip_util.h"
25 #include "ui/gfx/geometry/rect.h" 27 #include "ui/gfx/geometry/rect.h"
26 #include "ui/gfx/geometry/size.h" 28 #include "ui/gfx/geometry/size.h"
27 #include "ui/views/view.h" 29 #include "ui/views/view.h"
28 #include "ui/views/widget/widget.h" 30 #include "ui/views/widget/widget.h"
29 #include "ui/wm/core/window_util.h" 31 #include "ui/wm/core/window_util.h"
30 #include "ui/wm/public/activation_client.h" 32 #include "ui/wm/public/activation_client.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 70 }
69 71
70 aura::Window* GetActivatableWindow(aura::Window* window) { 72 aura::Window* GetActivatableWindow(aura::Window* window) {
71 return ::wm::GetActivatableWindow(window); 73 return ::wm::GetActivatableWindow(window);
72 } 74 }
73 75
74 bool CanActivateWindow(aura::Window* window) { 76 bool CanActivateWindow(aura::Window* window) {
75 return ::wm::CanActivateWindow(window); 77 return ::wm::CanActivateWindow(window);
76 } 78 }
77 79
80 aura::Window* GetFocusedWindow() {
81 return aura::client::GetFocusClient(Shell::GetPrimaryRootWindow())
82 ->GetFocusedWindow();
83 }
84
85 aura::Window* GetCaptureWindow() {
86 return aura::client::GetCaptureWindow(Shell::GetPrimaryRootWindow());
87 }
88
78 bool IsWindowUserPositionable(aura::Window* window) { 89 bool IsWindowUserPositionable(aura::Window* window) {
79 return GetWindowState(window)->IsUserPositionable(); 90 return GetWindowState(window)->IsUserPositionable();
80 } 91 }
81 92
82 void PinWindow(aura::Window* window, bool trusted) { 93 void PinWindow(aura::Window* window, bool trusted) {
83 wm::WMEvent event(trusted ? wm::WM_EVENT_TRUSTED_PIN : wm::WM_EVENT_PIN); 94 wm::WMEvent event(trusted ? wm::WM_EVENT_TRUSTED_PIN : wm::WM_EVENT_PIN);
84 wm::GetWindowState(window)->OnWMEvent(&event); 95 wm::GetWindowState(window)->OnWMEvent(&event);
85 } 96 }
86 97
87 void SetAutoHideShelf(aura::Window* window, bool autohide) { 98 void SetAutoHideShelf(aura::Window* window, bool autohide) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 131 }
121 132
122 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { 133 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) {
123 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) 134 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary))
124 << container->GetName(); 135 << container->GetName();
125 container->SetProperty(kSnapChildrenToPixelBoundary, true); 136 container->SetProperty(kSnapChildrenToPixelBoundary, true);
126 } 137 }
127 138
128 } // namespace wm 139 } // namespace wm
129 } // namespace ash 140 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_util.h ('k') | chrome/browser/chromeos/arc/boot_phase_monitor/arc_instance_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698