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.
5 #include "chrome/browser/ui/panels/panel_mouse_watcher.h"
7 #include "chrome/browser/ui/panels/panel_mouse_watcher_observer.h"
8 #include "ui/gfx/point.h"
10 PanelMouseWatcher::PanelMouseWatcher() {
13 PanelMouseWatcher::~PanelMouseWatcher() {
16 void PanelMouseWatcher::AddObserver(PanelMouseWatcherObserver
* observer
) {
17 bool already_started
= observers_
.might_have_observers();
18 observers_
.AddObserver(observer
);
23 void PanelMouseWatcher::RemoveObserver(PanelMouseWatcherObserver
* observer
) {
24 DCHECK(observers_
.HasObserver(observer
));
25 observers_
.RemoveObserver(observer
);
26 if (!observers_
.might_have_observers())
30 void PanelMouseWatcher::NotifyMouseMovement(const gfx::Point
& mouse_position
) {
31 FOR_EACH_OBSERVER(PanelMouseWatcherObserver
, observers_
,
32 OnMouseMove(mouse_position
));