Chromium Code Reviews| Index: ui/aura/desktop.h |
| diff --git a/ui/aura/desktop.h b/ui/aura/desktop.h |
| index 521876a273e99f7a1d353e75d33d505681d616d6..9cb7c18ca70bffae25161930f8cb08b39b471f52 100644 |
| --- a/ui/aura/desktop.h |
| +++ b/ui/aura/desktop.h |
| @@ -31,6 +31,12 @@ class MouseEvent; |
| // Desktop is responsible for hosting a set of windows. |
| class AURA_EXPORT Desktop : public ui::CompositorDelegate { |
| public: |
| + // Observers can listen to various events on the Desktop. |
| + class Observer { |
| + public: |
| + virtual void OnDesktopResized(const gfx::Size& new_size) {} |
|
sky
2011/10/12 21:11:27
I think we should make these pure virtual. Also, a
sadrul
2011/10/12 21:33:23
Done. I kept the empty implementation for WindowOb
|
| + }; |
| + |
| Desktop(); |
| virtual ~Desktop(); |
| @@ -100,6 +106,11 @@ class AURA_EXPORT Desktop : public ui::CompositorDelegate { |
| // It must never be stored. |
| MessageLoop::Dispatcher* GetDispatcher(); |
| + // Add/remove observer. |
| + void AddObserver(Observer* observer); |
| + void RemoveObserver(Observer* observer); |
| + bool HasObserver(Observer* observer); |
|
sky
2011/10/12 21:11:27
Unless we need HasObserver, don't add it.
sadrul
2011/10/12 21:33:23
It's not needed right now. Removed.
|
| + |
| static Desktop* GetInstance(); |
| private: |
| @@ -128,6 +139,8 @@ class AURA_EXPORT Desktop : public ui::CompositorDelegate { |
| // destruction. |
| bool in_destructor_; |
| + ObserverList<Observer> observers_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(Desktop); |
| }; |