OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_BASE_X_WORK_AREA_WATCHER_X_H_ |
| 6 #define UI_BASE_X_WORK_AREA_WATCHER_X_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/memory/singleton.h" |
| 11 #include "base/observer_list.h" |
| 12 #include "ui/base/ui_export.h" |
| 13 #include "ui/base/x/x11_util.h" |
| 14 |
| 15 namespace ui { |
| 16 |
| 17 class WorkAreaWatcherXObserver; |
| 18 |
| 19 namespace internal { |
| 20 class RootWindowPropertyWatcherX; |
| 21 } |
| 22 |
| 23 // This is a helper class that is used to keep track of changes to work area. |
| 24 // Add an observer to track changes. |
| 25 class UI_EXPORT WorkAreaWatcherX { |
| 26 public: |
| 27 static WorkAreaWatcherX* GetInstance(); |
| 28 static void AddObserver(WorkAreaWatcherXObserver* observer); |
| 29 static void RemoveObserver(WorkAreaWatcherXObserver* observer); |
| 30 |
| 31 private: |
| 32 friend struct DefaultSingletonTraits<WorkAreaWatcherX>; |
| 33 friend class ui::internal::RootWindowPropertyWatcherX; |
| 34 |
| 35 WorkAreaWatcherX(); |
| 36 ~WorkAreaWatcherX(); |
| 37 |
| 38 // Gets the atom for the default display for the property this class is |
| 39 // watching for. |
| 40 static Atom GetPropertyAtom(); |
| 41 |
| 42 // Notify observers that the work area has changed. |
| 43 static void Notify(); |
| 44 |
| 45 // Instance method that implements Notify(). |
| 46 void NotifyWorkAreaChanged(); |
| 47 |
| 48 ObserverList<WorkAreaWatcherXObserver> observers_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(WorkAreaWatcherX); |
| 51 }; |
| 52 |
| 53 } // namespace ui |
| 54 |
| 55 #endif // UI_BASE_X_WORK_AREA_WATCHER_X_H_ |
OLD | NEW |