OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_manager.h" | 5 #include "chrome/browser/ui/panels/panel_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/fullscreen.h" | 10 #include "chrome/browser/fullscreen.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return true; | 61 return true; |
62 } | 62 } |
63 | 63 |
64 PanelManager::PanelManager() | 64 PanelManager::PanelManager() |
65 : panel_mouse_watcher_(PanelMouseWatcher::Create()), | 65 : panel_mouse_watcher_(PanelMouseWatcher::Create()), |
66 auto_sizing_enabled_(true), | 66 auto_sizing_enabled_(true), |
67 is_full_screen_(false) { | 67 is_full_screen_(false) { |
68 detached_strip_.reset(new DetachedPanelStrip(this)); | 68 detached_strip_.reset(new DetachedPanelStrip(this)); |
69 docked_strip_.reset(new DockedPanelStrip(this)); | 69 docked_strip_.reset(new DockedPanelStrip(this)); |
70 overflow_strip_.reset(new OverflowPanelStrip(this)); | 70 overflow_strip_.reset(new OverflowPanelStrip(this)); |
71 drag_controller_.reset(new PanelDragController()); | 71 drag_controller_.reset(new PanelDragController(this)); |
72 auto_hiding_desktop_bar_ = AutoHidingDesktopBar::Create(this); | 72 auto_hiding_desktop_bar_ = AutoHidingDesktopBar::Create(this); |
73 OnDisplayChanged(); | 73 OnDisplayChanged(); |
74 } | 74 } |
75 | 75 |
76 PanelManager::~PanelManager() { | 76 PanelManager::~PanelManager() { |
77 } | 77 } |
78 | 78 |
79 void PanelManager::OnDisplayChanged() { | 79 void PanelManager::OnDisplayChanged() { |
80 #if defined(OS_MACOSX) | 80 #if defined(OS_MACOSX) |
81 // On OSX, panels should be dropped all the way to the bottom edge of the | 81 // On OSX, panels should be dropped all the way to the bottom edge of the |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 full_screen_mode_timer_.Stop(); | 151 full_screen_mode_timer_.Stop(); |
152 | 152 |
153 drag_controller_->OnPanelClosed(panel); | 153 drag_controller_->OnPanelClosed(panel); |
154 | 154 |
155 content::NotificationService::current()->Notify( | 155 content::NotificationService::current()->Notify( |
156 chrome::NOTIFICATION_PANEL_CLOSED, | 156 chrome::NOTIFICATION_PANEL_CLOSED, |
157 content::Source<Panel>(panel), | 157 content::Source<Panel>(panel), |
158 content::NotificationService::NoDetails()); | 158 content::NotificationService::NoDetails()); |
159 } | 159 } |
160 | 160 |
161 void PanelManager::StartDragging(Panel* panel) { | 161 void PanelManager::StartDragging(Panel* panel, |
162 drag_controller_->StartDragging(panel); | 162 const gfx::Point& mouse_location) { |
| 163 drag_controller_->StartDragging(panel, mouse_location); |
163 } | 164 } |
164 | 165 |
165 void PanelManager::Drag(int delta_x, int delta_y) { | 166 void PanelManager::Drag(const gfx::Point& mouse_location) { |
166 drag_controller_->Drag(delta_x, delta_y); | 167 drag_controller_->Drag(mouse_location); |
167 } | 168 } |
168 | 169 |
169 void PanelManager::EndDragging(bool cancelled) { | 170 void PanelManager::EndDragging(bool cancelled) { |
170 drag_controller_->EndDragging(cancelled); | 171 drag_controller_->EndDragging(cancelled); |
171 } | 172 } |
172 | 173 |
173 void PanelManager::OnPanelExpansionStateChanged(Panel* panel) { | 174 void PanelManager::OnPanelExpansionStateChanged(Panel* panel) { |
174 docked_strip_->OnPanelExpansionStateChanged(panel); | 175 docked_strip_->OnPanelExpansionStateChanged(panel); |
175 } | 176 } |
176 | 177 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return panels; | 274 return panels; |
274 } | 275 } |
275 | 276 |
276 int PanelManager::overflow_strip_width() const { | 277 int PanelManager::overflow_strip_width() const { |
277 return kOverflowStripThickness; | 278 return kOverflowStripThickness; |
278 } | 279 } |
279 | 280 |
280 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 281 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
281 panel_mouse_watcher_.reset(watcher); | 282 panel_mouse_watcher_.reset(watcher); |
282 } | 283 } |
OLD | NEW |