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

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2696873002: Change OnWindowInputEvent to use display_id to find the host and update event root_location in WS. (Closed)
Patch Set: sadrul@ comments Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/ui/ws/window_tree.h" 5 #include "services/ui/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return false; 150 return false;
151 if (id) 151 if (id)
152 *id = iter->second; 152 *id = iter->second;
153 return true; 153 return true;
154 } 154 }
155 155
156 bool WindowTree::HasRoot(const ServerWindow* window) const { 156 bool WindowTree::HasRoot(const ServerWindow* window) const {
157 return roots_.count(window) > 0; 157 return roots_.count(window) > 0;
158 } 158 }
159 159
160 const ServerWindow* WindowTree::FindRootFor(const ServerWindow* window) const {
161 for (const ServerWindow* parent = window; parent; parent = parent->parent()) {
162 if (roots_.count(parent))
163 return parent;
164 }
165 return nullptr;
166 }
167
160 const ServerWindow* WindowTree::GetWindowByClientId( 168 const ServerWindow* WindowTree::GetWindowByClientId(
161 const ClientWindowId& id) const { 169 const ClientWindowId& id) const {
162 auto iter = client_id_to_window_id_map_.find(id); 170 auto iter = client_id_to_window_id_map_.find(id);
163 return iter == client_id_to_window_id_map_.end() ? nullptr 171 return iter == client_id_to_window_id_map_.end() ? nullptr
164 : GetWindow(iter->second); 172 : GetWindow(iter->second);
165 } 173 }
166 174
167 const Display* WindowTree::GetDisplay(const ServerWindow* window) const { 175 const Display* WindowTree::GetDisplay(const ServerWindow* window) const {
168 return window ? display_manager()->GetDisplayContaining(window) : nullptr; 176 return window ? display_manager()->GetDisplayContaining(window) : nullptr;
169 } 177 }
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 2187 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
2180 effect_bitmask, callback); 2188 effect_bitmask, callback);
2181 } 2189 }
2182 2190
2183 void WindowTree::PerformOnDragDropDone() { 2191 void WindowTree::PerformOnDragDropDone() {
2184 client()->OnDragDropDone(); 2192 client()->OnDragDropDone();
2185 } 2193 }
2186 2194
2187 } // namespace ws 2195 } // namespace ws
2188 } // namespace ui 2196 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698