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

Side by Side Diff: ash/aura/wm_root_window_controller_aura.cc

Issue 2168733002: Splits debug_commands into aura and non-aura parts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/aura/wm_root_window_controller_aura.h" 5 #include "ash/aura/wm_root_window_controller_aura.h"
6 6
7 #include "ash/aura/wm_shelf_aura.h" 7 #include "ash/aura/wm_shelf_aura.h"
8 #include "ash/aura/wm_shell_aura.h" 8 #include "ash/aura/wm_shell_aura.h"
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h" 10 #include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
11 #include "ash/common/wm_root_window_controller_observer.h" 11 #include "ash/common/wm_root_window_controller_observer.h"
12 #include "ash/display/window_tree_host_manager.h" 12 #include "ash/display/window_tree_host_manager.h"
13 #include "ash/root_window_controller.h" 13 #include "ash/root_window_controller.h"
14 #include "ash/shelf/shelf.h" 14 #include "ash/shelf/shelf.h"
15 #include "ash/shelf/shelf_widget.h" 15 #include "ash/shelf/shelf_widget.h"
16 #include "ash/shell.h" 16 #include "ash/shell.h"
17 #include "ash/wm/workspace_controller.h" 17 #include "ash/wm/workspace_controller.h"
18 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
19 #include "ui/aura/window_event_dispatcher.h"
19 #include "ui/aura/window_property.h" 20 #include "ui/aura/window_property.h"
21 #include "ui/aura/window_tree_host.h"
20 #include "ui/events/event_targeter.h" 22 #include "ui/events/event_targeter.h"
21 #include "ui/events/event_utils.h" 23 #include "ui/events/event_utils.h"
22 24
23 DECLARE_WINDOW_PROPERTY_TYPE(ash::WmRootWindowControllerAura*); 25 DECLARE_WINDOW_PROPERTY_TYPE(ash::WmRootWindowControllerAura*);
24 26
25 namespace ash { 27 namespace ash {
26 28
27 // TODO(sky): it likely makes more sense to hang this off RootWindowSettings. 29 // TODO(sky): it likely makes more sense to hang this off RootWindowSettings.
28 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::WmRootWindowControllerAura, 30 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::WmRootWindowControllerAura,
29 kWmRootWindowControllerKey, 31 kWmRootWindowControllerKey,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 aura::Window* root = root_window_controller_->GetRootWindow(); 109 aura::Window* root = root_window_controller_->GetRootWindow();
108 ui::MouseEvent test_event(ui::ET_MOUSE_MOVED, location_in_root, 110 ui::MouseEvent test_event(ui::ET_MOUSE_MOVED, location_in_root,
109 location_in_root, ui::EventTimeForNow(), 111 location_in_root, ui::EventTimeForNow(),
110 ui::EF_NONE, ui::EF_NONE); 112 ui::EF_NONE, ui::EF_NONE);
111 ui::EventTarget* event_handler = static_cast<ui::EventTarget*>(root) 113 ui::EventTarget* event_handler = static_cast<ui::EventTarget*>(root)
112 ->GetEventTargeter() 114 ->GetEventTargeter()
113 ->FindTargetForEvent(root, &test_event); 115 ->FindTargetForEvent(root, &test_event);
114 return WmWindowAura::Get(static_cast<aura::Window*>(event_handler)); 116 return WmWindowAura::Get(static_cast<aura::Window*>(event_handler));
115 } 117 }
116 118
119 gfx::Point WmRootWindowControllerAura::GetLastMouseLocationInRoot() {
120 return root_window_controller_->GetHost()
121 ->dispatcher()
122 ->GetLastMouseLocationInRoot();
123 }
124
117 void WmRootWindowControllerAura::AddObserver( 125 void WmRootWindowControllerAura::AddObserver(
118 WmRootWindowControllerObserver* observer) { 126 WmRootWindowControllerObserver* observer) {
119 observers_.AddObserver(observer); 127 observers_.AddObserver(observer);
120 } 128 }
121 129
122 void WmRootWindowControllerAura::RemoveObserver( 130 void WmRootWindowControllerAura::RemoveObserver(
123 WmRootWindowControllerObserver* observer) { 131 WmRootWindowControllerObserver* observer) {
124 observers_.RemoveObserver(observer); 132 observers_.RemoveObserver(observer);
125 } 133 }
126 134
(...skipping 17 matching lines...) Expand all
144 WmWindow* root_window) { 152 WmWindow* root_window) {
145 if (WmWindowAura::GetAuraWindow(root_window) != 153 if (WmWindowAura::GetAuraWindow(root_window) !=
146 root_window_controller_->GetRootWindow()) 154 root_window_controller_->GetRootWindow())
147 return; 155 return;
148 156
149 FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_, 157 FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_,
150 OnShelfAlignmentChanged()); 158 OnShelfAlignmentChanged());
151 } 159 }
152 160
153 } // namespace ash 161 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698