OLD | NEW |
1 // Copyright (c) 2009 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 #include <X11/Xlib.h> | 5 #include <X11/Xlib.h> |
6 #include <gdk/gdk.h> | 6 #include <gdk/gdk.h> |
7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
8 | 8 |
9 #include "app/active_window_watcher_x.h" | 9 #include "ui/base/x/active_window_watcher_x.h" |
| 10 |
| 11 namespace ui { |
10 | 12 |
11 static Atom kNetActiveWindowAtom = None; | 13 static Atom kNetActiveWindowAtom = None; |
12 | 14 |
13 // static | 15 // static |
14 ActiveWindowWatcherX* ActiveWindowWatcherX::GetInstance() { | 16 ActiveWindowWatcherX* ActiveWindowWatcherX::GetInstance() { |
15 return Singleton<ActiveWindowWatcherX>::get(); | 17 return Singleton<ActiveWindowWatcherX>::get(); |
16 } | 18 } |
17 | 19 |
18 // static | 20 // static |
19 void ActiveWindowWatcherX::AddObserver(Observer* observer) { | 21 void ActiveWindowWatcherX::AddObserver(Observer* observer) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 window_watcher); | 95 window_watcher); |
94 XEvent* xev = static_cast<XEvent*>(xevent); | 96 XEvent* xev = static_cast<XEvent*>(xevent); |
95 | 97 |
96 if (xev->xany.type == PropertyNotify && | 98 if (xev->xany.type == PropertyNotify && |
97 xev->xproperty.atom == kNetActiveWindowAtom) { | 99 xev->xproperty.atom == kNetActiveWindowAtom) { |
98 watcher->NotifyActiveWindowChanged(); | 100 watcher->NotifyActiveWindowChanged(); |
99 } | 101 } |
100 | 102 |
101 return GDK_FILTER_CONTINUE; | 103 return GDK_FILTER_CONTINUE; |
102 } | 104 } |
| 105 |
| 106 } // namespace ui |
OLD | NEW |