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 <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "ui/aura/aura_export.h" | 14 #include "ui/aura/aura_export.h" |
15 #include "ui/gfx/compositor/layer_delegate.h" | 15 #include "ui/gfx/compositor/layer_delegate.h" |
16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
17 | 17 |
18 class SkCanvas; | 18 class SkCanvas; |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
21 class Compositor; | 21 class Compositor; |
22 class Layer; | 22 class Layer; |
23 } | 23 } |
24 | 24 |
25 namespace aura { | 25 namespace aura { |
26 | 26 |
27 class Desktop; | 27 class Desktop; |
| 28 class EventFilter; |
28 class KeyEvent; | 29 class KeyEvent; |
29 class LayoutManager; | 30 class LayoutManager; |
30 class MouseEvent; | 31 class MouseEvent; |
31 class WindowDelegate; | 32 class WindowDelegate; |
32 class EventFilter; | |
33 | 33 |
34 namespace internal { | 34 namespace internal { |
35 class FocusManager; | 35 class FocusManager; |
| 36 class RootWindow; |
36 } | 37 } |
37 | 38 |
38 // Aura window implementation. Interesting events are sent to the | 39 // Aura window implementation. Interesting events are sent to the |
39 // WindowDelegate. | 40 // WindowDelegate. |
40 // TODO(beng): resolve ownership. | 41 // TODO(beng): resolve ownership. |
41 class AURA_EXPORT Window : public ui::LayerDelegate { | 42 class AURA_EXPORT Window : public ui::LayerDelegate { |
42 public: | 43 public: |
43 typedef std::vector<Window*> Windows; | 44 typedef std::vector<Window*> Windows; |
44 | 45 |
45 enum Visibility { | 46 enum Visibility { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 Window* GetEventHandlerForPoint(const gfx::Point& point); | 134 Window* GetEventHandlerForPoint(const gfx::Point& point); |
134 | 135 |
135 // Returns the FocusManager for the Window, which may be attached to a parent | 136 // Returns the FocusManager for the Window, which may be attached to a parent |
136 // Window. Can return NULL if the Window has no FocusManager. | 137 // Window. Can return NULL if the Window has no FocusManager. |
137 virtual internal::FocusManager* GetFocusManager(); | 138 virtual internal::FocusManager* GetFocusManager(); |
138 | 139 |
139 // The Window does not own this object. | 140 // The Window does not own this object. |
140 void set_user_data(void* user_data) { user_data_ = user_data; } | 141 void set_user_data(void* user_data) { user_data_ = user_data; } |
141 void* user_data() const { return user_data_; } | 142 void* user_data() const { return user_data_; } |
142 | 143 |
| 144 // Does a mouse capture on the window. This does nothing if the window isn't |
| 145 // showing (VISIBILITY_SHOWN) or isn't contained in a valid window hierarchy. |
| 146 void SetCapture(); |
| 147 |
| 148 // Releases a mouse capture. |
| 149 void ReleaseCapture(); |
| 150 |
| 151 // Returns true if this window has a mouse capture. |
| 152 bool HasCapture(); |
| 153 |
| 154 protected: |
| 155 // Returns the RootWindow or NULL if we don't yet have a RootWindow. |
| 156 virtual internal::RootWindow* GetRoot(); |
| 157 |
143 private: | 158 private: |
144 // If SchedulePaint has been invoked on the Window the delegate is notified. | |
145 void UpdateLayerCanvas(); | |
146 | |
147 // Schedules a paint for the Window's entire bounds. | 159 // Schedules a paint for the Window's entire bounds. |
148 void SchedulePaint(); | 160 void SchedulePaint(); |
149 | 161 |
150 // Overridden from ui::LayerDelegate: | 162 // Overridden from ui::LayerDelegate: |
151 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 163 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
152 | 164 |
153 WindowDelegate* delegate_; | 165 WindowDelegate* delegate_; |
154 | 166 |
155 Visibility visibility_; | 167 Visibility visibility_; |
156 | 168 |
(...skipping 16 matching lines...) Expand all Loading... |
173 scoped_ptr<LayoutManager> layout_manager_; | 185 scoped_ptr<LayoutManager> layout_manager_; |
174 | 186 |
175 void* user_data_; | 187 void* user_data_; |
176 | 188 |
177 DISALLOW_COPY_AND_ASSIGN(Window); | 189 DISALLOW_COPY_AND_ASSIGN(Window); |
178 }; | 190 }; |
179 | 191 |
180 } // namespace aura | 192 } // namespace aura |
181 | 193 |
182 #endif // UI_AURA_WINDOW_H_ | 194 #endif // UI_AURA_WINDOW_H_ |
OLD | NEW |