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