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_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ | 5 #ifndef UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ |
6 #define UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ | 6 #define UI_BASE_X_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 25 matching lines...) Expand all Loading... |
36 static void RemoveObserver(Observer* observer); | 36 static void RemoveObserver(Observer* observer); |
37 | 37 |
38 // Checks if the WM supports the active window property. Note that the return | 38 // Checks if the WM supports the active window property. Note that the return |
39 // value can change, especially during system startup. | 39 // value can change, especially during system startup. |
40 static bool WMSupportsActivation(); | 40 static bool WMSupportsActivation(); |
41 | 41 |
42 private: | 42 private: |
43 friend struct DefaultSingletonTraits<ActiveWindowWatcherX>; | 43 friend struct DefaultSingletonTraits<ActiveWindowWatcherX>; |
44 | 44 |
45 ActiveWindowWatcherX(); | 45 ActiveWindowWatcherX(); |
46 virtual ~ActiveWindowWatcherX(); | 46 ~ActiveWindowWatcherX(); |
47 | 47 |
48 void Init(); | 48 void Init(); |
49 | 49 |
50 // Sends a notification out through the NotificationService that the active | 50 // Sends a notification out through the NotificationService that the active |
51 // window has changed. | 51 // window has changed. |
52 void NotifyActiveWindowChanged(); | 52 void NotifyActiveWindowChanged(); |
53 | 53 |
54 // Callback for PropertyChange XEvents. | 54 // Callback for PropertyChange XEvents. |
55 CHROMEG_CALLBACK_1(ActiveWindowWatcherX, GdkFilterReturn, | 55 CHROMEG_CALLBACK_1(ActiveWindowWatcherX, GdkFilterReturn, |
56 OnWindowXEvent, GdkXEvent*, GdkEvent*); | 56 OnWindowXEvent, GdkXEvent*, GdkEvent*); |
57 | 57 |
58 ObserverList<Observer> observers_; | 58 ObserverList<Observer> observers_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX); | 60 DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace ui | 63 } // namespace ui |
64 | 64 |
65 #endif // UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ | 65 #endif // UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ |
OLD | NEW |