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

Unified Diff: ui/aura/desktop.h

Issue 8253001: aura: Some changes in Window and Desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698