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 17 matching lines...) Expand all Loading... |
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 | 31 |
32 private: | 32 private: |
33 friend struct DefaultSingletonTraits<ActiveWindowWatcherX>; | 33 friend struct DefaultSingletonTraits<ActiveWindowWatcherX>; |
34 | 34 |
35 ActiveWindowWatcherX(); | 35 ActiveWindowWatcherX(); |
36 ~ActiveWindowWatcherX(); | 36 ~ActiveWindowWatcherX(); |
37 | 37 |
| 38 static ActiveWindowWatcherX* GetInstance(); |
| 39 |
38 void Init(); | 40 void Init(); |
39 | 41 |
40 // Sends a notification out through the NotificationService that the active | 42 // Sends a notification out through the NotificationService that the active |
41 // window has changed. | 43 // window has changed. |
42 void NotifyActiveWindowChanged(); | 44 void NotifyActiveWindowChanged(); |
43 | 45 |
44 // Callback for PropertyChange XEvents. | 46 // Callback for PropertyChange XEvents. |
45 static GdkFilterReturn OnWindowXEvent(GdkXEvent* xevent, | 47 static GdkFilterReturn OnWindowXEvent(GdkXEvent* xevent, |
46 GdkEvent* event, | 48 GdkEvent* event, |
47 gpointer window_watcher); | 49 gpointer window_watcher); |
48 | 50 |
49 ObserverList<Observer> observers_; | 51 ObserverList<Observer> observers_; |
50 | 52 |
51 DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX); | 53 DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX); |
52 }; | 54 }; |
53 | 55 |
54 #endif // APP_ACTIVE_WINDOW_WATCHER_X_H_ | 56 #endif // APP_ACTIVE_WINDOW_WATCHER_X_H_ |
OLD | NEW |