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

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

Issue 9318002: Makes GetRootWindow() public on Window so we can begin to convert uses of RootWindow::GetInstance(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | « ui/aura/root_window.cc ('k') | ui/aura/window.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 #ifndef UI_AURA_WINDOW_H_ 5 #ifndef UI_AURA_WINDOW_H_
6 #define UI_AURA_WINDOW_H_ 6 #define UI_AURA_WINDOW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // end of ~Window(). 98 // end of ~Window().
99 ui::Layer* AcquireLayer(); 99 ui::Layer* AcquireLayer();
100 100
101 WindowDelegate* delegate() { return delegate_; } 101 WindowDelegate* delegate() { return delegate_; }
102 102
103 const gfx::Rect& bounds() const; 103 const gfx::Rect& bounds() const;
104 104
105 Window* parent() { return parent_; } 105 Window* parent() { return parent_; }
106 const Window* parent() const { return parent_; } 106 const Window* parent() const { return parent_; }
107 107
108 // Returns the RootWindow that contains this Window or NULL if the Window is
109 // not contained by a RootWindow.
110 virtual RootWindow* GetRootWindow();
111 virtual const RootWindow* GetRootWindow() const;
112
108 // The Window does not own this object. 113 // The Window does not own this object.
109 void set_user_data(void* user_data) { user_data_ = user_data; } 114 void set_user_data(void* user_data) { user_data_ = user_data; }
110 void* user_data() const { return user_data_; } 115 void* user_data() const { return user_data_; }
111 116
112 // Changes the visibility of the window. 117 // Changes the visibility of the window.
113 void Show(); 118 void Show();
114 void Hide(); 119 void Hide();
115 // Returns true if this window and all its ancestors are visible. 120 // Returns true if this window and all its ancestors are visible.
116 bool IsVisible() const; 121 bool IsVisible() const;
117 122
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // Fix ViewProp to be able to tell if the property exists and 287 // Fix ViewProp to be able to tell if the property exists and
283 // change it to -1. 288 // change it to -1.
284 void* GetProperty(const char* name) const; 289 void* GetProperty(const char* name) const;
285 int GetIntProperty(const char* name) const; 290 int GetIntProperty(const char* name) const;
286 291
287 // Returns true if this window is currently stopping event 292 // Returns true if this window is currently stopping event
288 // propagation for any windows behind it in the z-order. 293 // propagation for any windows behind it in the z-order.
289 bool StopsEventPropagation() const; 294 bool StopsEventPropagation() const;
290 295
291 protected: 296 protected:
292 // Returns the root window or NULL if we aren't yet attached to the root
293 // window.
294 virtual RootWindow* GetRootWindow();
295
296 // Called when the |window| is being detached from the root window 297 // Called when the |window| is being detached from the root window
297 // by being removed from its parent. It is called before |parent_| is 298 // by being removed from its parent. It is called before |parent_| is
298 // set to NULL. 299 // set to NULL.
299 virtual void OnWindowDetachingFromRootWindow(aura::Window* window); 300 virtual void OnWindowDetachingFromRootWindow(aura::Window* window);
300 301
301 // Called when the |window| is attached to the root window by being added 302 // Called when the |window| is attached to the root window by being added
302 // to its parent. 303 // to its parent.
303 virtual void OnWindowAttachedToRootWindow(aura::Window* window); 304 virtual void OnWindowAttachedToRootWindow(aura::Window* window);
304 305
305 private: 306 private:
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // TODO(oshima): Consolidcate ViewProp and aura::window property 398 // TODO(oshima): Consolidcate ViewProp and aura::window property
398 // implementation. 399 // implementation.
399 std::map<const char*, void*> prop_map_; 400 std::map<const char*, void*> prop_map_;
400 401
401 DISALLOW_COPY_AND_ASSIGN(Window); 402 DISALLOW_COPY_AND_ASSIGN(Window);
402 }; 403 };
403 404
404 } // namespace aura 405 } // namespace aura
405 406
406 #endif // UI_AURA_WINDOW_H_ 407 #endif // UI_AURA_WINDOW_H_
OLDNEW
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/aura/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698