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

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: 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/memory/singleton.h"
10 #include "base/observer_list.h"
11 #include "ui/base/ui_export.h"
12 #include "ui/base/x/x11_util.h"
13
14 namespace ui {
15
16 // This is a helper class that is used to keep track of changes to work area.
17 // Add an observer to track changes.
18 class UI_EXPORT WorkAreaWatcherX {
19 public:
20 class Observer {
sky 2011/11/18 17:54:22 Move this into it's own header.
prasadt 2011/11/18 22:31:42 I see nested classes being in the same header as a
sky 2011/11/18 22:44:58 From the style guide: 'Prefer putting delegate cla
prasadt 2011/11/21 23:36:49 Done.
21 public:
22 virtual void WorkAreaChanged() = 0;
23
24 protected:
25 virtual ~Observer() {}
26 };
27
28 static WorkAreaWatcherX* GetInstance();
29 static void AddObserver(Observer* observer);
30 static void RemoveObserver(Observer* observer);
31 static Atom GetPropertyAtom();
32
33 // Sends a notification out through the NotificationService that the work
34 // area has changed.
35 static void Notify();
36
37 private:
38 friend struct DefaultSingletonTraits<WorkAreaWatcherX>;
39
40 WorkAreaWatcherX() { }
sky 2011/11/18 17:54:22 Don't inline these.
prasadt 2011/11/18 22:31:42 Done.
41 ~WorkAreaWatcherX() { }
42 void NotifyWorkAreaChanged();
43
44 ObserverList<Observer> observers_;
45
46 DISALLOW_COPY_AND_ASSIGN(WorkAreaWatcherX);
47 };
48
49 } // namespace ui
50
51 #endif // UI_BASE_X_WORK_AREA_WATCHER_X_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698