| Index: chrome/browser/ui/panels/panel_browser_view.cc
|
| ===================================================================
|
| --- chrome/browser/ui/panels/panel_browser_view.cc (revision 102199)
|
| +++ chrome/browser/ui/panels/panel_browser_view.cc (working copy)
|
| @@ -8,7 +8,7 @@
|
| #include "chrome/browser/ui/panels/panel.h"
|
| #include "chrome/browser/ui/panels/panel_browser_frame_view.h"
|
| #include "chrome/browser/ui/panels/panel_manager.h"
|
| -#include "chrome/browser/ui/panels/panel_mouse_watcher_win.h"
|
| +#include "chrome/browser/ui/panels/panel_mouse_watcher.h"
|
| #include "chrome/browser/ui/views/frame/browser_frame.h"
|
| #include "grit/chromium_strings.h"
|
| #include "ui/base/animation/slide_animation.h"
|
| @@ -51,6 +51,8 @@
|
| }
|
|
|
| PanelBrowserView::~PanelBrowserView() {
|
| + if (PanelMouseWatcher::GetInstance()->IsSubscribed(this))
|
| + PanelMouseWatcher::GetInstance()->RemoveSubscriber(this);
|
| }
|
|
|
| void PanelBrowserView::Init() {
|
| @@ -70,12 +72,6 @@
|
| bounds_animator_.reset();
|
|
|
| ::BrowserView::Close();
|
| -
|
| - // Stop the global mouse watcher only if we do not have any panels up.
|
| -#if defined(OS_WIN)
|
| - if (panel_->manager()->num_panels() == 1)
|
| - StopMouseWatcher();
|
| -#endif
|
| }
|
|
|
| bool PanelBrowserView::CanResize() const {
|
| @@ -215,6 +211,7 @@
|
| int height;
|
| switch (expansion_state) {
|
| case Panel::EXPANDED:
|
| + PanelMouseWatcher::GetInstance()->RemoveSubscriber(this);
|
| height = restored_height_;
|
| break;
|
| case Panel::TITLE_ONLY:
|
| @@ -222,12 +219,7 @@
|
| break;
|
| case Panel::MINIMIZED:
|
| height = PanelManager::minimized_panel_height();
|
| -
|
| - // Start the mouse watcher so that we can bring up the minimized panels.
|
| - // TODO(jianli): Need to support mouse watching in ChromeOS.
|
| -#if defined(OS_WIN)
|
| - EnsureMouseWatcherStarted();
|
| -#endif
|
| + PanelMouseWatcher::GetInstance()->AddSubscriber(this);
|
| break;
|
| default:
|
| NOTREACHED();
|
| @@ -480,7 +472,7 @@
|
|
|
| // static
|
| PanelMouseWatcher* NativePanelTesting::GetPanelMouseWatcherInstance() {
|
| - return NULL;
|
| + return PanelMouseWatcher::GetInstance();
|
| }
|
|
|
| NativePanelTestingWin::NativePanelTestingWin(
|
| @@ -516,10 +508,10 @@
|
|
|
| void NativePanelTestingWin::SetMousePositionForMinimizeRestore(
|
| const gfx::Point& hover_point) {
|
| - NOTIMPLEMENTED();
|
| + PanelMouseWatcher::GetInstance()->HandleMouseMovement(hover_point);
|
| + MessageLoopForUI::current()->RunAllPending();
|
| }
|
|
|
| int NativePanelTestingWin::TitleOnlyHeight() const {
|
| - NOTIMPLEMENTED();
|
| - return -1;
|
| + return panel_browser_view_->GetFrameView()->NonClientTopBorderHeight();
|
| }
|
|
|