Chromium Code Reviews| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 | 167 |
| 168 void PanelManager::Drag(int delta_x, int delta_y) { | 168 void PanelManager::Drag(int delta_x, int delta_y) { |
| 169 drag_controller_->Drag(delta_x, delta_y); | 169 drag_controller_->Drag(delta_x, delta_y); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void PanelManager::EndDragging(bool cancelled) { | 172 void PanelManager::EndDragging(bool cancelled) { |
| 173 drag_controller_->EndDragging(cancelled); | 173 drag_controller_->EndDragging(cancelled); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void PanelManager::OnPanelExpansionStateChanged(Panel* panel) { | 176 void PanelManager::OnPanelExpansionStateChanged(Panel* panel) { |
| 177 docked_strip_->OnPanelExpansionStateChanged(panel); | 177 // For panels outside of the docked strip changing state is a no-op |
|
jennb
2012/03/12 18:26:27
Maybe reword to say "...but this method may be cal
| |
| 178 // but we still allow it to be called because panels can | |
| 179 // jump from strip to strip virtually at any moment. | |
|
jianli
2012/03/12 18:08:56
Your comment seems not to be consistent with if ch
| |
| 180 if (panel->panel_strip() == docked_strip_.get()) | |
| 181 docked_strip_->OnPanelExpansionStateChanged(panel); | |
| 178 } | 182 } |
| 179 | 183 |
| 180 void PanelManager::OnWindowAutoResized(Panel* panel, | 184 void PanelManager::OnWindowAutoResized(Panel* panel, |
| 181 const gfx::Size& preferred_window_size) { | 185 const gfx::Size& preferred_window_size) { |
| 182 DCHECK(auto_sizing_enabled_); | 186 DCHECK(auto_sizing_enabled_); |
| 187 // DCHECK(panel->panel_strip() == docked_strip_.get()); | |
|
jianli
2012/03/12 18:08:56
Why is DCHECK commented out?
| |
| 183 docked_strip_->ResizePanelWindow(panel, preferred_window_size); | 188 docked_strip_->ResizePanelWindow(panel, preferred_window_size); |
| 184 } | 189 } |
| 185 | 190 |
| 186 void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) { | 191 void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) { |
| 192 // DCHECK(panel->panel_strip() == docked_strip_.get()); | |
|
jianli
2012/03/12 18:08:56
ditto.
| |
| 187 docked_strip_->ResizePanelWindow(panel, new_size); | 193 docked_strip_->ResizePanelWindow(panel, new_size); |
| 188 panel->SetAutoResizable(false); | 194 panel->SetAutoResizable(false); |
| 189 } | 195 } |
| 190 | 196 |
| 191 void PanelManager::MovePanelToStrip(Panel* panel, | 197 void PanelManager::MovePanelToStrip(Panel* panel, |
| 192 PanelStrip::Type new_layout) { | 198 PanelStrip::Type new_layout) { |
| 193 DCHECK(panel); | 199 DCHECK(panel); |
| 194 PanelStrip* current_strip = panel->panel_strip(); | 200 PanelStrip* current_strip = panel->panel_strip(); |
| 195 DCHECK(current_strip); | 201 DCHECK(current_strip); |
| 196 DCHECK_NE(current_strip->type(), new_layout); | 202 DCHECK_NE(current_strip->type(), new_layout); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 return panels; | 328 return panels; |
| 323 } | 329 } |
| 324 | 330 |
| 325 int PanelManager::overflow_strip_width() const { | 331 int PanelManager::overflow_strip_width() const { |
| 326 return kOverflowStripThickness; | 332 return kOverflowStripThickness; |
| 327 } | 333 } |
| 328 | 334 |
| 329 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 335 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
| 330 panel_mouse_watcher_.reset(watcher); | 336 panel_mouse_watcher_.reset(watcher); |
| 331 } | 337 } |
| OLD | NEW |