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

Side by Side Diff: ui/base/x/work_area_watcher_x.cc

Issue 8595003: Have panels respond to changes in work area on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review feedback. 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 #include "ui/base/x/work_area_watcher_x.h"
6
7 #include "ui/base/x/root_window_property_watcher_x.h"
8 #include "ui/base/x/x11_util.h"
9
10 namespace ui {
11
12 static const char* kNetWorkArea = "_NET_WORKAREA";
13
14 WorkAreaWatcherX::Observer::~Observer() {
15 }
16
17 // static
18 WorkAreaWatcherX* WorkAreaWatcherX::GetInstance() {
19 return Singleton<WorkAreaWatcherX>::get();
20 }
21
22 // static
23 void WorkAreaWatcherX::AddObserver(Observer* observer) {
24 // Ensure that RootWindowPropertyWatcherX exists.
25 internal::RootWindowPropertyWatcherX::GetInstance();
26 GetInstance()->observers_.AddObserver(observer);
27 }
28
29 // static
30 void WorkAreaWatcherX::RemoveObserver(Observer* observer) {
31 GetInstance()->observers_.RemoveObserver(observer);
32 }
33
34 // static
35 void WorkAreaWatcherX::Notify() {
36 GetInstance()->NotifyWorkAreaChanged();
37 }
38
39 // static
40 Atom WorkAreaWatcherX::GetPropertyAtom() {
41 return GetAtom(kNetWorkArea);
42 }
43
44 WorkAreaWatcherX::WorkAreaWatcherX() {
45 }
46
47 WorkAreaWatcherX::~WorkAreaWatcherX() {
48 }
49
50 void WorkAreaWatcherX::NotifyWorkAreaChanged() {
51 FOR_EACH_OBSERVER(Observer, observers_, WorkAreaChanged());
52 }
53
54 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698