Chromium Code Reviews| OLD | NEW |
|---|---|
| (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* kNetWorkArea = "_NET_WORKAREA"; | |
|
sky
2011/11/21 23:50:32
const char* const
prasadt
2011/11/22 00:46:34
Done.
| |
| 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 | |
| OLD | NEW |