Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: chrome/browser/ui/panels/panel_browser_view.cc

Issue 7977037: Refactor Win panel mouse watcher to use PanelMouseWatcher base class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browser_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_browser_view.cc
===================================================================
--- chrome/browser/ui/panels/panel_browser_view.cc (revision 102599)
+++ 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();
}
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browser_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698