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

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: 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 // static
15 WorkAreaWatcherX* WorkAreaWatcherX::GetInstance() {
16 return Singleton<WorkAreaWatcherX>::get();
17 }
18
19 // static
20 void WorkAreaWatcherX::AddObserver(Observer* observer) {
21 // Ensure that RootWindowPropertyWatcherX exists.
22 RootWindowPropertyWatcherX::GetInstance();
23 GetInstance()->observers_.AddObserver(observer);
24 }
25
26 // static
27 void WorkAreaWatcherX::RemoveObserver(Observer* observer) {
28 GetInstance()->observers_.RemoveObserver(observer);
29 }
30
31 // static
32 void WorkAreaWatcherX::Notify() {
33 GetInstance()->NotifyWorkAreaChanged();
34 }
35
36 // static
37 Atom WorkAreaWatcherX::GetPropertyAtom() {
38 return GetAtomForScreenProperty(kNetWorkArea);
39 }
40
41 void WorkAreaWatcherX::NotifyWorkAreaChanged() {
42 FOR_EACH_OBSERVER(Observer, observers_, WorkAreaChanged());
43 }
44
45 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698