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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 drag_controller_->Drag(mouse_location); | 180 drag_controller_->Drag(mouse_location); |
181 } | 181 } |
182 | 182 |
183 void PanelManager::EndDragging(bool cancelled) { | 183 void PanelManager::EndDragging(bool cancelled) { |
184 drag_controller_->EndDragging(cancelled); | 184 drag_controller_->EndDragging(cancelled); |
185 } | 185 } |
186 | 186 |
187 void PanelManager::StartResizingByMouse(Panel* panel, | 187 void PanelManager::StartResizingByMouse(Panel* panel, |
188 const gfx::Point& mouse_location, | 188 const gfx::Point& mouse_location, |
189 panel::ResizingSides sides) { | 189 panel::ResizingSides sides) { |
190 if (panel->panel_strip() && panel->panel_strip()->CanResizePanel(panel) && | 190 if (panel->CanResizeByMouse() != panel::NOT_RESIZABLE && |
191 sides != panel::RESIZE_NONE) | 191 sides != panel::RESIZE_NONE) |
192 resize_controller_->StartResizing(panel, mouse_location, sides); | 192 resize_controller_->StartResizing(panel, mouse_location, sides); |
193 } | 193 } |
194 | 194 |
195 void PanelManager::ResizeByMouse(const gfx::Point& mouse_location) { | 195 void PanelManager::ResizeByMouse(const gfx::Point& mouse_location) { |
196 if (resize_controller_->IsResizing()) | 196 if (resize_controller_->IsResizing()) |
197 resize_controller_->Resize(mouse_location); | 197 resize_controller_->Resize(mouse_location); |
198 } | 198 } |
199 | 199 |
200 void PanelManager::EndResizingByMouse(bool cancelled) { | 200 void PanelManager::EndResizingByMouse(bool cancelled) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // See the comment in OnWindowAutoResized() | 232 // See the comment in OnWindowAutoResized() |
233 if (panel_strip == overflow_strip_.get()) | 233 if (panel_strip == overflow_strip_.get()) |
234 docked_strip_->ResizePanelWindow(panel, new_size); | 234 docked_strip_->ResizePanelWindow(panel, new_size); |
235 else | 235 else |
236 panel_strip->ResizePanelWindow(panel, new_size); | 236 panel_strip->ResizePanelWindow(panel, new_size); |
237 panel->SetAutoResizable(false); | 237 panel->SetAutoResizable(false); |
238 } | 238 } |
239 | 239 |
240 void PanelManager::OnPanelResizedByMouse(Panel* panel, | 240 void PanelManager::OnPanelResizedByMouse(Panel* panel, |
241 const gfx::Rect& new_bounds) { | 241 const gfx::Rect& new_bounds) { |
| 242 panel->set_restored_size(new_bounds.size()); |
242 panel->panel_strip()->OnPanelResizedByMouse(panel, new_bounds); | 243 panel->panel_strip()->OnPanelResizedByMouse(panel, new_bounds); |
243 panel->SetAutoResizable(false); | 244 panel->SetAutoResizable(false); |
244 | |
245 } | 245 } |
246 | 246 |
247 void PanelManager::MovePanelToStrip( | 247 void PanelManager::MovePanelToStrip( |
248 Panel* panel, | 248 Panel* panel, |
249 PanelStrip::Type new_layout, | 249 PanelStrip::Type new_layout, |
250 PanelStrip::PositioningMask positioning_mask) { | 250 PanelStrip::PositioningMask positioning_mask) { |
251 DCHECK(panel); | 251 DCHECK(panel); |
252 PanelStrip* current_strip = panel->panel_strip(); | 252 PanelStrip* current_strip = panel->panel_strip(); |
253 DCHECK(current_strip); | 253 DCHECK(current_strip); |
254 DCHECK_NE(current_strip->type(), new_layout); | 254 DCHECK_NE(current_strip->type(), new_layout); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 base::TimeDelta::FromMilliseconds(PanelManager::AdjustTimeInterval( | 379 base::TimeDelta::FromMilliseconds(PanelManager::AdjustTimeInterval( |
380 kMoveNewPanelToOverflowDelayMs))); | 380 kMoveNewPanelToOverflowDelayMs))); |
381 } | 381 } |
382 | 382 |
383 content::NotificationService::current()->Notify( | 383 content::NotificationService::current()->Notify( |
384 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 384 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
385 content::Source<Panel>(panel), | 385 content::Source<Panel>(panel), |
386 content::NotificationService::NoDetails()); | 386 content::NotificationService::NoDetails()); |
387 } | 387 } |
388 | 388 |
OLD | NEW |