Index: ui/base/x/work_area_watcher_x.cc |
diff --git a/ui/base/x/work_area_watcher_x.cc b/ui/base/x/work_area_watcher_x.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..22af1db6d7afc491a23d87ed14d3628625abf2d4 |
--- /dev/null |
+++ b/ui/base/x/work_area_watcher_x.cc |
@@ -0,0 +1,45 @@ |
+// 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. |
+ |
+#include "ui/base/x/work_area_watcher_x.h" |
+ |
+#include "ui/base/x/root_window_property_watcher_x.h" |
+#include "ui/base/x/x11_util.h" |
+ |
+namespace ui { |
+ |
+static const char* kNetWorkArea = "_NET_WORKAREA"; |
+ |
+// static |
+WorkAreaWatcherX* WorkAreaWatcherX::GetInstance() { |
+ return Singleton<WorkAreaWatcherX>::get(); |
+} |
+ |
+// static |
+void WorkAreaWatcherX::AddObserver(Observer* observer) { |
+ // Ensure that RootWindowPropertyWatcherX exists. |
+ RootWindowPropertyWatcherX::GetInstance(); |
+ GetInstance()->observers_.AddObserver(observer); |
+} |
+ |
+// static |
+void WorkAreaWatcherX::RemoveObserver(Observer* observer) { |
+ GetInstance()->observers_.RemoveObserver(observer); |
+} |
+ |
+// static |
+void WorkAreaWatcherX::Notify() { |
+ GetInstance()->NotifyWorkAreaChanged(); |
+} |
+ |
+// static |
+Atom WorkAreaWatcherX::GetPropertyAtom() { |
+ return GetAtomForScreenProperty(kNetWorkArea); |
+} |
+ |
+void WorkAreaWatcherX::NotifyWorkAreaChanged() { |
+ FOR_EACH_OBSERVER(Observer, observers_, WorkAreaChanged()); |
+} |
+ |
+} // namespace ui |