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

Unified Diff: ui/base/x/active_window_watcher_x.h

Issue 8595003: Have panels respond to changes in work area on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/x/active_window_watcher_x.h
diff --git a/ui/base/x/active_window_watcher_x.h b/ui/base/x/active_window_watcher_x.h
index 4fa6b65898ddd21a540db0376f2bb3532672431a..2cfbd7f61a23c9314f89514c59944438d59b88ce 100644
--- a/ui/base/x/active_window_watcher_x.h
+++ b/ui/base/x/active_window_watcher_x.h
@@ -8,16 +8,15 @@
#include <gdk/gdk.h>
-#include "base/basictypes.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
-#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/ui_export.h"
+#include "ui/base/x/x11_util.h"
namespace ui {
// This is a helper class that is used to keep track of which window the X
-// window manager thinks is active. Add an Observer to listener for changes to
+// window manager thinks is active. Add an Observer to listen for changes to
// the active window.
class UI_EXPORT ActiveWindowWatcherX {
public:
@@ -31,9 +30,13 @@ class UI_EXPORT ActiveWindowWatcherX {
};
static ActiveWindowWatcherX* GetInstance();
-
static void AddObserver(Observer* observer);
static void RemoveObserver(Observer* observer);
+ static Atom GetPropertyAtom();
sky 2011/11/18 17:54:22 Add a description.
prasadt 2011/11/18 22:31:42 Done.
+
+ // Sends a notification out through the NotificationService that the active
+ // window has changed.
+ static void Notify();
sky 2011/11/18 17:54:22 This doesn't notify through the NOtificationServic
prasadt 2011/11/18 22:31:42 I did consider that option. Didn't do it for a few
sky 2011/11/18 22:44:58 I'm ok with it as long as you make RootWindowPrope
prasadt 2011/11/21 23:36:49 Done.
// Checks if the WM supports the active window property. Note that the return
// value can change, especially during system startup.
@@ -42,19 +45,10 @@ class UI_EXPORT ActiveWindowWatcherX {
private:
friend struct DefaultSingletonTraits<ActiveWindowWatcherX>;
- ActiveWindowWatcherX();
- ~ActiveWindowWatcherX();
-
- void Init();
-
- // Sends a notification out through the NotificationService that the active
- // window has changed.
+ ActiveWindowWatcherX() {}
sky 2011/11/18 17:54:22 Don't inline these.
prasadt 2011/11/18 22:31:42 Done. Curious though why this is discouraged.
sky 2011/11/18 22:44:58 See threads from erg on this. Your class is probab
sky 2011/11/18 22:46:39 Ha. I was just asked to review a change that cause
+ ~ActiveWindowWatcherX() {}
void NotifyActiveWindowChanged();
- // Callback for PropertyChange XEvents.
- CHROMEG_CALLBACK_1(ActiveWindowWatcherX, GdkFilterReturn,
- OnWindowXEvent, GdkXEvent*, GdkEvent*);
-
ObserverList<Observer> observers_;
DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX);

Powered by Google App Engine
This is Rietveld 408576698