Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Side by Side Diff: app/active_window_watcher_x.h

Issue 6257006: Move a bunch of random other files to src/ui/base... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | app/active_window_watcher_x.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef APP_ACTIVE_WINDOW_WATCHER_X_H_
6 #define APP_ACTIVE_WINDOW_WATCHER_X_H_
7 #pragma once
8
9 #include <gdk/gdk.h>
10
11 #include "base/basictypes.h"
12 #include "base/observer_list.h"
13 #include "base/singleton.h"
14
15 // This is a helper class that is used to keep track of which window the X
16 // window manager thinks is active. Add an Observer to listener for changes to
17 // the active window.
18 class ActiveWindowWatcherX {
19 public:
20 class Observer {
21 public:
22 // |active_window| will be NULL if the active window isn't one of Chrome's.
23 virtual void ActiveWindowChanged(GdkWindow* active_window) = 0;
24
25 protected:
26 virtual ~Observer() {}
27 };
28
29 static ActiveWindowWatcherX* GetInstance();
30
31 static void AddObserver(Observer* observer);
32 static void RemoveObserver(Observer* observer);
33
34 private:
35 friend struct DefaultSingletonTraits<ActiveWindowWatcherX>;
36
37 ActiveWindowWatcherX();
38 ~ActiveWindowWatcherX();
39
40 void Init();
41
42 // Sends a notification out through the NotificationService that the active
43 // window has changed.
44 void NotifyActiveWindowChanged();
45
46 // Callback for PropertyChange XEvents.
47 static GdkFilterReturn OnWindowXEvent(GdkXEvent* xevent,
48 GdkEvent* event,
49 gpointer window_watcher);
50
51 ObserverList<Observer> observers_;
52
53 DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX);
54 };
55
56 #endif // APP_ACTIVE_WINDOW_WATCHER_X_H_
OLDNEW
« no previous file with comments | « no previous file | app/active_window_watcher_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698