Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 APP_ACTIVE_WINDOW_WATCHER_X_H_ | 5 #ifndef APP_ACTIVE_WINDOW_WATCHER_X_H_ |
| 6 #define APP_ACTIVE_WINDOW_WATCHER_X_H_ | 6 #define APP_ACTIVE_WINDOW_WATCHER_X_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 public: | 21 public: |
| 22 // |active_window| will be NULL if the active window isn't one of Chrome's. | 22 // |active_window| will be NULL if the active window isn't one of Chrome's. |
| 23 virtual void ActiveWindowChanged(GdkWindow* active_window) = 0; | 23 virtual void ActiveWindowChanged(GdkWindow* active_window) = 0; |
| 24 | 24 |
| 25 protected: | 25 protected: |
| 26 virtual ~Observer() {} | 26 virtual ~Observer() {} |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 static void AddObserver(Observer* observer); | 29 static void AddObserver(Observer* observer); |
| 30 static void RemoveObserver(Observer* observer); | 30 static void RemoveObserver(Observer* observer); |
| 31 static ActiveWindowWatcherX* GetInstance(); | |
|
M-A Ruel
2010/12/03 21:06:07
I don't think this class is necessary.
Satish
2010/12/04 23:00:40
Removed
| |
| 31 | 32 |
| 32 private: | 33 private: |
| 33 friend struct DefaultSingletonTraits<ActiveWindowWatcherX>; | 34 friend struct DefaultSingletonTraits<ActiveWindowWatcherX>; |
| 34 | 35 |
| 35 ActiveWindowWatcherX(); | 36 ActiveWindowWatcherX(); |
| 36 ~ActiveWindowWatcherX(); | 37 ~ActiveWindowWatcherX(); |
| 37 | 38 |
| 38 void Init(); | 39 void Init(); |
| 39 | 40 |
| 40 // Sends a notification out through the NotificationService that the active | 41 // Sends a notification out through the NotificationService that the active |
| 41 // window has changed. | 42 // window has changed. |
| 42 void NotifyActiveWindowChanged(); | 43 void NotifyActiveWindowChanged(); |
| 43 | 44 |
| 44 // Callback for PropertyChange XEvents. | 45 // Callback for PropertyChange XEvents. |
| 45 static GdkFilterReturn OnWindowXEvent(GdkXEvent* xevent, | 46 static GdkFilterReturn OnWindowXEvent(GdkXEvent* xevent, |
| 46 GdkEvent* event, | 47 GdkEvent* event, |
| 47 gpointer window_watcher); | 48 gpointer window_watcher); |
| 48 | 49 |
| 49 ObserverList<Observer> observers_; | 50 ObserverList<Observer> observers_; |
| 50 | 51 |
| 51 DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX); | 52 DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX); |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 #endif // APP_ACTIVE_WINDOW_WATCHER_X_H_ | 55 #endif // APP_ACTIVE_WINDOW_WATCHER_X_H_ |
| OLD | NEW |