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

Side by Side Diff: chrome/browser/ui/panels/panel_mouse_watcher.cc

Issue 7981012: Add Mouse hover behavior to Mac Panels when minimized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cr feedback 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.h" 5 #include "chrome/browser/ui/panels/panel_mouse_watcher.h"
6 6
7 #include "chrome/browser/ui/panels/panel_manager.h" 7 #include "chrome/browser/ui/panels/panel_manager.h"
8 8
9 PanelMouseWatcher::PanelMouseWatcher() 9 PanelMouseWatcher::PanelMouseWatcher()
10 : bring_up_titlebar_(false), is_testing_mode_enabled_(false) { 10 : bring_up_titlebar_(false), is_testing_mode_enabled_(false) {
11 } 11 }
12 12
13 PanelMouseWatcher::~PanelMouseWatcher() { 13 PanelMouseWatcher::~PanelMouseWatcher() {
14 DCHECK(subscribers_.size() == 0);
14 } 15 }
15 16
16 void PanelMouseWatcher::AddSubscriber(NativePanel* native_panel) { 17 void PanelMouseWatcher::AddSubscriber(NativePanel* native_panel) {
17 if (is_testing_mode_enabled_) 18 if (is_testing_mode_enabled_)
18 return; 19 return;
19 20
20 if (subscribers_.count(native_panel) == 0) { 21 if (subscribers_.count(native_panel) == 0) {
21 subscribers_.insert(native_panel); 22 subscribers_.insert(native_panel);
22 DCHECK_LE(subscribers_.size(), 23 DCHECK_LE(subscribers_.size(),
23 static_cast<size_t>(PanelManager::GetInstance()->num_panels())); 24 static_cast<size_t>(PanelManager::GetInstance()->num_panels()));
(...skipping 28 matching lines...) Expand all
52 PanelManager* panel_manager = PanelManager::GetInstance(); 53 PanelManager* panel_manager = PanelManager::GetInstance();
53 54
54 bool bring_up_titlebar = 55 bool bring_up_titlebar =
55 panel_manager->ShouldBringUpTitlebars( 56 panel_manager->ShouldBringUpTitlebars(
56 mouse_position.x(), mouse_position.y()); 57 mouse_position.x(), mouse_position.y());
57 if (bring_up_titlebar == bring_up_titlebar_) 58 if (bring_up_titlebar == bring_up_titlebar_)
58 return; 59 return;
59 bring_up_titlebar_ = bring_up_titlebar; 60 bring_up_titlebar_ = bring_up_titlebar;
60 panel_manager->BringUpOrDownTitlebars(bring_up_titlebar); 61 panel_manager->BringUpOrDownTitlebars(bring_up_titlebar);
61 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698