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

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: Fix compile linux_view and chromeos. 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
« no previous file with comments | « ui/base/x/work_area_watcher_x.h ('k') | ui/base/x/work_area_watcher_x_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/work_area_watcher_x_observer.h"
9 #include "ui/base/x/x11_util.h"
10
11 namespace ui {
12
13 static const char* const kNetWorkArea = "_NET_WORKAREA";
14
15 // static
16 WorkAreaWatcherX* WorkAreaWatcherX::GetInstance() {
17 return Singleton<WorkAreaWatcherX>::get();
18 }
19
20 // static
21 void WorkAreaWatcherX::AddObserver(WorkAreaWatcherXObserver* observer) {
22 // Ensure that RootWindowPropertyWatcherX exists.
23 internal::RootWindowPropertyWatcherX::GetInstance();
24 GetInstance()->observers_.AddObserver(observer);
25 }
26
27 // static
28 void WorkAreaWatcherX::RemoveObserver(WorkAreaWatcherXObserver* observer) {
29 GetInstance()->observers_.RemoveObserver(observer);
30 }
31
32 // static
33 void WorkAreaWatcherX::Notify() {
34 GetInstance()->NotifyWorkAreaChanged();
35 }
36
37 // static
38 Atom WorkAreaWatcherX::GetPropertyAtom() {
39 return GetAtom(kNetWorkArea);
40 }
41
42 WorkAreaWatcherX::WorkAreaWatcherX() {
43 }
44
45 WorkAreaWatcherX::~WorkAreaWatcherX() {
46 }
47
48 void WorkAreaWatcherX::NotifyWorkAreaChanged() {
49 FOR_EACH_OBSERVER(WorkAreaWatcherXObserver, observers_, WorkAreaChanged());
50 }
51
52 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/x/work_area_watcher_x.h ('k') | ui/base/x/work_area_watcher_x_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698