This source file includes following definitions.
- AddObserver
- RemoveObserver
- NotifyMouseMovement
#include "chrome/browser/ui/panels/panel_mouse_watcher.h"
#include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h"
#include "ui/gfx/point.h"
PanelMouseWatcher::PanelMouseWatcher() {
}
PanelMouseWatcher::~PanelMouseWatcher() {
}
void PanelMouseWatcher::AddObserver(PanelMouseWatcherObserver* observer) {
bool already_started = observers_.might_have_observers();
observers_.AddObserver(observer);
if (!already_started)
Start();
}
void PanelMouseWatcher::RemoveObserver(PanelMouseWatcherObserver* observer) {
DCHECK(observers_.HasObserver(observer));
observers_.RemoveObserver(observer);
if (!observers_.might_have_observers())
Stop();
}
void PanelMouseWatcher::NotifyMouseMovement(const gfx::Point& mouse_position) {
FOR_EACH_OBSERVER(PanelMouseWatcherObserver, observers_,
OnMouseMove(mouse_position));
}