OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 class SkCanvas; | 26 class SkCanvas; |
27 | 27 |
28 namespace ui { | 28 namespace ui { |
29 class Layer; | 29 class Layer; |
30 class Transform; | 30 class Transform; |
31 } | 31 } |
32 | 32 |
33 namespace aura { | 33 namespace aura { |
34 | 34 |
35 class Desktop; | |
36 class EventFilter; | 35 class EventFilter; |
37 class LayoutManager; | 36 class LayoutManager; |
| 37 class RootWindow; |
38 class WindowDelegate; | 38 class WindowDelegate; |
39 class WindowObserver; | 39 class WindowObserver; |
40 | 40 |
41 namespace internal { | 41 namespace internal { |
42 class FocusManager; | 42 class FocusManager; |
43 } | 43 } |
44 | 44 |
45 // Aura window implementation. Interesting events are sent to the | 45 // Aura window implementation. Interesting events are sent to the |
46 // WindowDelegate. | 46 // WindowDelegate. |
47 // TODO(beng): resolve ownership. | 47 // TODO(beng): resolve ownership. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // not animating, it simply returns the current bounds. | 118 // not animating, it simply returns the current bounds. |
119 gfx::Rect GetTargetBounds() const; | 119 gfx::Rect GetTargetBounds() const; |
120 | 120 |
121 // Marks the a portion of window as needing to be painted. | 121 // Marks the a portion of window as needing to be painted. |
122 void SchedulePaintInRect(const gfx::Rect& rect); | 122 void SchedulePaintInRect(const gfx::Rect& rect); |
123 | 123 |
124 // Sets the contents of the window. | 124 // Sets the contents of the window. |
125 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); | 125 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); |
126 | 126 |
127 // Sets the parent window of the window. If NULL, the window is parented to | 127 // Sets the parent window of the window. If NULL, the window is parented to |
128 // the desktop's window. | 128 // the root window. |
129 void SetParent(Window* parent); | 129 void SetParent(Window* parent); |
130 | 130 |
131 // Stacks the specified child of this Window at the front of the z-order. | 131 // Stacks the specified child of this Window at the front of the z-order. |
132 void StackChildAtTop(Window* child); | 132 void StackChildAtTop(Window* child); |
133 | 133 |
134 // Stacks |child| above |other|. Does nothing if |child| is already above | 134 // Stacks |child| above |other|. Does nothing if |child| is already above |
135 // |other|. | 135 // |other|. |
136 void StackChildAbove(Window* child, Window* other); | 136 void StackChildAbove(Window* child, Window* other); |
137 | 137 |
138 // Returns true if this window can be activated. | 138 // Returns true if this window can be activated. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 // Returns the window property for given |name|. Returns NULL or 0 if | 255 // Returns the window property for given |name|. Returns NULL or 0 if |
256 // the property does not exist. | 256 // the property does not exist. |
257 // TODO(oshima): Returning 0 for non existing property is problematic. | 257 // TODO(oshima): Returning 0 for non existing property is problematic. |
258 // Fix ViewProp to be able to tell if the property exists and | 258 // Fix ViewProp to be able to tell if the property exists and |
259 // change it to -1. | 259 // change it to -1. |
260 void* GetProperty(const char* name) const; | 260 void* GetProperty(const char* name) const; |
261 int GetIntProperty(const char* name) const; | 261 int GetIntProperty(const char* name) const; |
262 | 262 |
263 protected: | 263 protected: |
264 // Returns the desktop or NULL if we aren't yet attached to a desktop. | 264 // Returns the root window or NULL if we aren't yet attached to the root |
265 virtual Desktop* GetDesktop(); | 265 // window. |
| 266 virtual RootWindow* GetRootWindow(); |
266 | 267 |
267 // Called when the |window| is detached from the desktop by being | 268 // Called when the |window| is detached from the root window by being removed |
268 // removed from its parent. | 269 // from its parent. |
269 virtual void WindowDetachedFromDesktop(aura::Window* window); | 270 virtual void WindowDetachedFromRootWindow(aura::Window* window); |
270 | 271 |
271 private: | 272 private: |
272 friend class LayoutManager; | 273 friend class LayoutManager; |
273 | 274 |
274 // Changes the bounds of the window without condition. | 275 // Changes the bounds of the window without condition. |
275 void SetBoundsInternal(const gfx::Rect& new_bounds); | 276 void SetBoundsInternal(const gfx::Rect& new_bounds); |
276 | 277 |
277 // Updates the visible state of the layer, but does not make visible-state | 278 // Updates the visible state of the layer, but does not make visible-state |
278 // specific changes. Called from Show()/Hide(). | 279 // specific changes. Called from Show()/Hide(). |
279 void SetVisible(bool visible); | 280 void SetVisible(bool visible); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 // TODO(oshima): Consolidcate ViewProp and aura::window property | 350 // TODO(oshima): Consolidcate ViewProp and aura::window property |
350 // implementation. | 351 // implementation. |
351 std::map<const char*, void*> prop_map_; | 352 std::map<const char*, void*> prop_map_; |
352 | 353 |
353 DISALLOW_COPY_AND_ASSIGN(Window); | 354 DISALLOW_COPY_AND_ASSIGN(Window); |
354 }; | 355 }; |
355 | 356 |
356 } // namespace aura | 357 } // namespace aura |
357 | 358 |
358 #endif // UI_AURA_WINDOW_H_ | 359 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |