Chromium Code Reviews| 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 <vector> | 10 #include <vector> |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 namespace aura { | 35 namespace aura { |
| 36 | 36 |
| 37 class Desktop; | 37 class Desktop; |
| 38 class EventFilter; | 38 class EventFilter; |
| 39 class KeyEvent; | 39 class KeyEvent; |
| 40 class LayoutManager; | 40 class LayoutManager; |
| 41 class MouseEvent; | 41 class MouseEvent; |
| 42 class ToplevelWindowContainer; | 42 class ToplevelWindowContainer; |
| 43 class TouchEvent; | 43 class TouchEvent; |
| 44 class WindowDelegate; | 44 class WindowDelegate; |
| 45 class WindowDragDropDelegate; | |
| 45 class WindowObserver; | 46 class WindowObserver; |
| 46 | 47 |
| 47 namespace internal { | 48 namespace internal { |
| 48 class FocusManager; | 49 class FocusManager; |
| 49 } | 50 } |
| 50 | 51 |
| 51 // Aura window implementation. Interesting events are sent to the | 52 // Aura window implementation. Interesting events are sent to the |
| 52 // WindowDelegate. | 53 // WindowDelegate. |
| 53 // TODO(beng): resolve ownership. | 54 // TODO(beng): resolve ownership. |
| 54 class AURA_EXPORT Window : public ui::LayerDelegate { | 55 class AURA_EXPORT Window : public ui::LayerDelegate { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 83 const gfx::Rect& bounds() const; | 84 const gfx::Rect& bounds() const; |
| 84 const gfx::Rect& restore_bounds() const { return restore_bounds_; } | 85 const gfx::Rect& restore_bounds() const { return restore_bounds_; } |
| 85 | 86 |
| 86 Window* parent() { return parent_; } | 87 Window* parent() { return parent_; } |
| 87 const Window* parent() const { return parent_; } | 88 const Window* parent() const { return parent_; } |
| 88 | 89 |
| 89 // The Window does not own this object. | 90 // The Window does not own this object. |
| 90 void set_user_data(void* user_data) { user_data_ = user_data; } | 91 void set_user_data(void* user_data) { user_data_ = user_data; } |
| 91 void* user_data() const { return user_data_; } | 92 void* user_data() const { return user_data_; } |
| 92 | 93 |
| 94 WindowDragDropDelegate* drag_drop_delegate() { return drag_drop_delegate_; } | |
| 95 void set_drag_drop_delegate(WindowDragDropDelegate* drag_drop_delegate) { | |
| 96 drag_drop_delegate_ = drag_drop_delegate; | |
| 97 } | |
| 98 | |
| 93 // Changes the visibility of the window. | 99 // Changes the visibility of the window. |
| 94 void Show(); | 100 void Show(); |
| 95 void Hide(); | 101 void Hide(); |
| 96 // Returns true if this window and all its ancestors are visible. | 102 // Returns true if this window and all its ancestors are visible. |
| 97 bool IsVisible() const; | 103 bool IsVisible() const; |
| 98 | 104 |
| 99 // Returns the window's bounds in screen coordinates. | 105 // Returns the window's bounds in screen coordinates. |
| 100 gfx::Rect GetScreenBounds() const; | 106 gfx::Rect GetScreenBounds() const; |
| 101 | 107 |
| 102 // Activates this window. Only top level windows can be activated. Requests | 108 // Activates this window. Only top level windows can be activated. Requests |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 | 348 |
| 343 ObserverList<WindowObserver> observers_; | 349 ObserverList<WindowObserver> observers_; |
| 344 | 350 |
| 345 // We're using ViewProp to store the property (for now) instead of | 351 // We're using ViewProp to store the property (for now) instead of |
| 346 // just using std::map because chrome is still using |ViewProp| class | 352 // just using std::map because chrome is still using |ViewProp| class |
| 347 // to create and access property. | 353 // to create and access property. |
| 348 // TODO(oshima): Consolidcate ViewProp and aura::window property | 354 // TODO(oshima): Consolidcate ViewProp and aura::window property |
| 349 // implementation. | 355 // implementation. |
| 350 std::map<const char*, void*> prop_map_; | 356 std::map<const char*, void*> prop_map_; |
| 351 | 357 |
| 358 // Delegate for handling drag and drop operations. | |
| 359 WindowDragDropDelegate* drag_drop_delegate_; | |
|
Ben Goodger (Google)
2011/11/11 17:26:53
I think we should not add this directly to Window.
varunjain
2011/11/15 19:39:33
Done.
| |
| 360 | |
| 352 DISALLOW_COPY_AND_ASSIGN(Window); | 361 DISALLOW_COPY_AND_ASSIGN(Window); |
| 353 }; | 362 }; |
| 354 | 363 |
| 355 } // namespace aura | 364 } // namespace aura |
| 356 | 365 |
| 357 #endif // UI_AURA_WINDOW_H_ | 366 #endif // UI_AURA_WINDOW_H_ |
| OLD | NEW |