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

Side by Side Diff: ui/base/x/work_area_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: Move observers into their own header files. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698