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 | |
sky
2011/11/21 23:50:32
nit: remove empty lines.
prasadt
2011/11/22 00:46:34
Done.
| |
21 class RootWindowPropertyWatcherX; | |
22 | |
23 } | |
24 | |
25 // This is a helper class that is used to keep track of changes to work area. | |
26 // Add an observer to track changes. | |
27 class UI_EXPORT WorkAreaWatcherX { | |
28 public: | |
29 static WorkAreaWatcherX* GetInstance(); | |
30 static void AddObserver(WorkAreaWatcherXObserver* observer); | |
31 static void RemoveObserver(WorkAreaWatcherXObserver* observer); | |
32 | |
33 // Gets the atom for the default display for the property this class is | |
34 // watching for. | |
35 static Atom GetPropertyAtom(); | |
sky
2011/11/21 23:50:32
Can this be private?
prasadt
2011/11/22 00:46:34
Done.
| |
36 | |
37 private: | |
38 friend struct DefaultSingletonTraits<WorkAreaWatcherX>; | |
39 friend class ui::internal::RootWindowPropertyWatcherX; | |
40 | |
41 // Notify observers that the work area has changed. | |
42 static void Notify(); | |
43 | |
44 WorkAreaWatcherX(); | |
sky
2011/11/21 23:50:32
constructor/destructor should be before other meth
prasadt
2011/11/22 00:46:34
Done.
| |
45 ~WorkAreaWatcherX(); | |
46 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.
| |
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 |