This source file includes following definitions.
- GetInstance
- AddObserver
- RemoveObserver
- Notify
- GetPropertyAtom
- NotifyWorkAreaChanged
#include "ui/base/x/work_area_watcher_x.h"
#include "base/memory/singleton.h"
#include "ui/base/work_area_watcher_observer.h"
#include "ui/base/x/root_window_property_watcher_x.h"
#include "ui/base/x/x11_util.h"
namespace ui {
static const char* const kNetWorkArea = "_NET_WORKAREA";
WorkAreaWatcherX* WorkAreaWatcherX::GetInstance() {
return Singleton<WorkAreaWatcherX>::get();
}
void WorkAreaWatcherX::AddObserver(WorkAreaWatcherObserver* observer) {
internal::RootWindowPropertyWatcherX::GetInstance();
GetInstance()->observers_.AddObserver(observer);
}
void WorkAreaWatcherX::RemoveObserver(WorkAreaWatcherObserver* observer) {
GetInstance()->observers_.RemoveObserver(observer);
}
void WorkAreaWatcherX::Notify() {
GetInstance()->NotifyWorkAreaChanged();
}
Atom WorkAreaWatcherX::GetPropertyAtom() {
return GetAtom(kNetWorkArea);
}
WorkAreaWatcherX::WorkAreaWatcherX() {
}
WorkAreaWatcherX::~WorkAreaWatcherX() {
}
void WorkAreaWatcherX::NotifyWorkAreaChanged() {
FOR_EACH_OBSERVER(WorkAreaWatcherObserver, observers_, WorkAreaChanged());
}
}