OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/panels/panel_mouse_watcher_win.h" | 5 #include "chrome/browser/ui/panels/panel_mouse_watcher_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
10 #include "chrome/browser/ui/panels/panel_manager.h" | 10 #include "chrome/browser/ui/panels/panel_manager.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void PanelMouseWatcherWin::OnMouseAction(int mouse_x, int mouse_y) { | 69 void PanelMouseWatcherWin::OnMouseAction(int mouse_x, int mouse_y) { |
70 PanelManager* panel_manager = PanelManager::GetInstance(); | 70 PanelManager* panel_manager = PanelManager::GetInstance(); |
71 | 71 |
72 bool bring_up_titlebar = | 72 bool bring_up_titlebar = |
73 panel_manager->ShouldBringUpTitleBarForAllMinimizedPanels( | 73 panel_manager->ShouldBringUpTitleBarForAllMinimizedPanels( |
74 mouse_x, mouse_y); | 74 mouse_x, mouse_y); |
75 if (bring_up_titlebar == bring_up_titlebar_) | 75 if (bring_up_titlebar == bring_up_titlebar_) |
76 return; | 76 return; |
77 bring_up_titlebar_ = bring_up_titlebar; | 77 bring_up_titlebar_ = bring_up_titlebar; |
78 | 78 |
79 panel_manager->BringUpOrDownTitleBarForAllMinimizedPanels(bring_up_titlebar); | 79 if (bring_up_titlebar) |
| 80 panel_manager->BringUpTitleBar(); |
| 81 else |
| 82 panel_manager->BringDownTitleBar(); |
80 } | 83 } |
81 | 84 |
82 } | 85 } |
83 | 86 |
84 void EnsureMouseWatcherStarted() { | 87 void EnsureMouseWatcherStarted() { |
85 if (!mouse_watcher.get()) | 88 if (!mouse_watcher.get()) |
86 mouse_watcher.reset(new PanelMouseWatcherWin()); | 89 mouse_watcher.reset(new PanelMouseWatcherWin()); |
87 } | 90 } |
88 | 91 |
89 void StopMouseWatcher() { | 92 void StopMouseWatcher() { |
90 mouse_watcher.reset(NULL); | 93 mouse_watcher.reset(NULL); |
91 } | 94 } |
92 | 95 |
93 bool IsMouseWatcherStarted() { | 96 bool IsMouseWatcherStarted() { |
94 return mouse_watcher.get() != NULL; | 97 return mouse_watcher.get() != NULL; |
95 } | 98 } |
OLD | NEW |