Index: ui/base/x/work_area_watcher_x.h |
diff --git a/ui/base/x/work_area_watcher_x.h b/ui/base/x/work_area_watcher_x.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f3322855ef5caa07de29bbe134f2a867d5756ad2 |
--- /dev/null |
+++ b/ui/base/x/work_area_watcher_x.h |
@@ -0,0 +1,55 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_BASE_X_WORK_AREA_WATCHER_X_H_ |
+#define UI_BASE_X_WORK_AREA_WATCHER_X_H_ |
+#pragma once |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/singleton.h" |
+#include "base/observer_list.h" |
+#include "ui/base/ui_export.h" |
+#include "ui/base/x/x11_util.h" |
+ |
+namespace ui { |
+ |
+class WorkAreaWatcherXObserver; |
+ |
+namespace internal { |
+ |
sky
2011/11/21 23:50:32
nit: remove empty lines.
prasadt
2011/11/22 00:46:34
Done.
|
+class RootWindowPropertyWatcherX; |
+ |
+} |
+ |
+// This is a helper class that is used to keep track of changes to work area. |
+// Add an observer to track changes. |
+class UI_EXPORT WorkAreaWatcherX { |
+ public: |
+ static WorkAreaWatcherX* GetInstance(); |
+ static void AddObserver(WorkAreaWatcherXObserver* observer); |
+ static void RemoveObserver(WorkAreaWatcherXObserver* observer); |
+ |
+ // Gets the atom for the default display for the property this class is |
+ // watching for. |
+ static Atom GetPropertyAtom(); |
sky
2011/11/21 23:50:32
Can this be private?
prasadt
2011/11/22 00:46:34
Done.
|
+ |
+ private: |
+ friend struct DefaultSingletonTraits<WorkAreaWatcherX>; |
+ friend class ui::internal::RootWindowPropertyWatcherX; |
+ |
+ // Notify observers that the work area has changed. |
+ static void Notify(); |
+ |
+ WorkAreaWatcherX(); |
sky
2011/11/21 23:50:32
constructor/destructor should be before other meth
prasadt
2011/11/22 00:46:34
Done.
|
+ ~WorkAreaWatcherX(); |
+ void NotifyWorkAreaChanged(); |
sky
2011/11/21 23:50:32
newline between 45 and 46 and add a descrption.
prasadt
2011/11/22 00:46:34
Done.
|
+ |
+ ObserverList<WorkAreaWatcherXObserver> observers_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WorkAreaWatcherX); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_BASE_X_WORK_AREA_WATCHER_X_H_ |