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

Side by Side Diff: ui/aura/window.h

Issue 253593004: aura: De-virtual a few methods in Window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 #ifndef UI_AURA_WINDOW_H_ 5 #ifndef UI_AURA_WINDOW_H_
6 #define UI_AURA_WINDOW_H_ 6 #define UI_AURA_WINDOW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 const gfx::Rect& bounds() const { return bounds_; } 110 const gfx::Rect& bounds() const { return bounds_; }
111 111
112 Window* parent() { return parent_; } 112 Window* parent() { return parent_; }
113 const Window* parent() const { return parent_; } 113 const Window* parent() const { return parent_; }
114 114
115 // Returns the root Window that contains this Window. The root Window is 115 // Returns the root Window that contains this Window. The root Window is
116 // defined as the Window that has a dispatcher. These functions return NULL if 116 // defined as the Window that has a dispatcher. These functions return NULL if
117 // the Window is contained in a hierarchy that does not have a dispatcher at 117 // the Window is contained in a hierarchy that does not have a dispatcher at
118 // its root. 118 // its root.
119 virtual Window* GetRootWindow(); 119 Window* GetRootWindow();
120 virtual const Window* GetRootWindow() const; 120 const Window* GetRootWindow() const;
121 121
122 WindowTreeHost* GetHost(); 122 WindowTreeHost* GetHost();
123 const WindowTreeHost* GetHost() const; 123 const WindowTreeHost* GetHost() const;
124 void set_host(WindowTreeHost* host) { host_ = host; } 124 void set_host(WindowTreeHost* host) { host_ = host; }
125 bool IsRootWindow() const { return !!host_; } 125 bool IsRootWindow() const { return !!host_; }
126 126
127 // The Window does not own this object. 127 // The Window does not own this object.
128 void set_user_data(void* user_data) { user_data_ = user_data; } 128 void set_user_data(void* user_data) { user_data_ = user_data; }
129 void* user_data() const { return user_data_; } 129 void* user_data() const { return user_data_; }
130 130
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // NULL, the function returns without modifying |point|. |target| cannot be 208 // NULL, the function returns without modifying |point|. |target| cannot be
209 // NULL. 209 // NULL.
210 static void ConvertPointToTarget(const Window* source, 210 static void ConvertPointToTarget(const Window* source,
211 const Window* target, 211 const Window* target,
212 gfx::Point* point); 212 gfx::Point* point);
213 static void ConvertRectToTarget(const Window* source, 213 static void ConvertRectToTarget(const Window* source,
214 const Window* target, 214 const Window* target,
215 gfx::Rect* rect); 215 gfx::Rect* rect);
216 216
217 // Moves the cursor to the specified location relative to the window. 217 // Moves the cursor to the specified location relative to the window.
218 virtual void MoveCursorTo(const gfx::Point& point_in_window); 218 void MoveCursorTo(const gfx::Point& point_in_window);
219 219
220 // Returns the cursor for the specified point, in window coordinates. 220 // Returns the cursor for the specified point, in window coordinates.
221 gfx::NativeCursor GetCursor(const gfx::Point& point) const; 221 gfx::NativeCursor GetCursor(const gfx::Point& point) const;
222 222
223 // Add/remove observer. 223 // Add/remove observer.
224 void AddObserver(WindowObserver* observer); 224 void AddObserver(WindowObserver* observer);
225 void RemoveObserver(WindowObserver* observer); 225 void RemoveObserver(WindowObserver* observer);
226 bool HasObserver(WindowObserver* observer); 226 bool HasObserver(WindowObserver* observer);
227 227
228 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; } 228 void set_ignore_events(bool ignore_events) { ignore_events_ = ignore_events; }
(...skipping 30 matching lines...) Expand all
259 Window* GetToplevelWindow(); 259 Window* GetToplevelWindow();
260 260
261 // Claims or relinquishes the claim to focus. 261 // Claims or relinquishes the claim to focus.
262 void Focus(); 262 void Focus();
263 void Blur(); 263 void Blur();
264 264
265 // Returns true if the Window is currently the focused window. 265 // Returns true if the Window is currently the focused window.
266 bool HasFocus() const; 266 bool HasFocus() const;
267 267
268 // Returns true if the Window can be focused. 268 // Returns true if the Window can be focused.
269 virtual bool CanFocus() const; 269 bool CanFocus() const;
270 270
271 // Returns true if the Window can receive events. 271 // Returns true if the Window can receive events.
272 virtual bool CanReceiveEvents() const; 272 bool CanReceiveEvents() const;
273 273
274 // Does a capture on the window. This does nothing if the window isn't showing 274 // Does a capture on the window. This does nothing if the window isn't showing
275 // (VISIBILITY_SHOWN) or isn't contained in a valid window hierarchy. 275 // (VISIBILITY_SHOWN) or isn't contained in a valid window hierarchy.
276 void SetCapture(); 276 void SetCapture();
277 277
278 // Releases a capture. 278 // Releases a capture.
279 void ReleaseCapture(); 279 void ReleaseCapture();
280 280
281 // Returns true if this window has capture. 281 // Returns true if this window has capture.
282 bool HasCapture(); 282 bool HasCapture();
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 }; 535 };
536 536
537 std::map<const void*, Value> prop_map_; 537 std::map<const void*, Value> prop_map_;
538 538
539 DISALLOW_COPY_AND_ASSIGN(Window); 539 DISALLOW_COPY_AND_ASSIGN(Window);
540 }; 540 };
541 541
542 } // namespace aura 542 } // namespace aura
543 543
544 #endif // UI_AURA_WINDOW_H_ 544 #endif // UI_AURA_WINDOW_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698