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/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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 } | 165 } |
| 166 | 166 |
| 167 void PanelManager::EndDragging(bool cancelled) { | 167 void PanelManager::EndDragging(bool cancelled) { |
| 168 drag_controller_->EndDragging(cancelled); | 168 drag_controller_->EndDragging(cancelled); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void PanelManager::OnPanelExpansionStateChanged(Panel* panel) { | 171 void PanelManager::OnPanelExpansionStateChanged(Panel* panel) { |
| 172 docked_strip_->OnPanelExpansionStateChanged(panel); | 172 docked_strip_->OnPanelExpansionStateChanged(panel); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void PanelManager::OnPreferredWindowSizeChanged( | 175 void PanelManager::OnPreferredWindowSizeChanged( |
|
jennb
2012/03/01 00:14:40
Match name to new DueToAutoResize?
levin
2012/03/01 01:56:19
Done as discussed.
| |
| 176 Panel* panel, const gfx::Size& preferred_window_size) { | 176 Panel* panel, const gfx::Size& preferred_window_size) { |
| 177 if (!auto_sizing_enabled_) { | 177 DCHECK(auto_sizing_enabled_); |
| 178 LOG(INFO) << "Resizing auto-resizable Panels is not supported yet."; | |
| 179 return; | |
| 180 } | |
| 181 docked_strip_->ResizePanelWindow(panel, preferred_window_size); | 178 docked_strip_->ResizePanelWindow(panel, preferred_window_size); |
| 182 } | 179 } |
| 183 | 180 |
| 184 void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) { | 181 void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) { |
| 185 // Explicit resizing is not allowed for auto-resizable panels for now. | |
| 186 // http://crbug.com/109343 | |
| 187 if (panel->auto_resizable()) | |
| 188 return; | |
| 189 | |
| 190 docked_strip_->ResizePanelWindow(panel, new_size); | 182 docked_strip_->ResizePanelWindow(panel, new_size); |
| 183 panel->SetAutoResizable(false); | |
| 191 } | 184 } |
| 192 | 185 |
| 193 bool PanelManager::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const { | 186 bool PanelManager::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const { |
| 194 return docked_strip_->ShouldBringUpTitlebars(mouse_x, mouse_y); | 187 return docked_strip_->ShouldBringUpTitlebars(mouse_x, mouse_y); |
| 195 } | 188 } |
| 196 | 189 |
| 197 void PanelManager::BringUpOrDownTitlebars(bool bring_up) { | 190 void PanelManager::BringUpOrDownTitlebars(bool bring_up) { |
| 198 docked_strip_->BringUpOrDownTitlebars(bring_up); | 191 docked_strip_->BringUpOrDownTitlebars(bring_up); |
| 199 } | 192 } |
| 200 | 193 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 return panels; | 264 return panels; |
| 272 } | 265 } |
| 273 | 266 |
| 274 int PanelManager::overflow_strip_width() const { | 267 int PanelManager::overflow_strip_width() const { |
| 275 return kOverflowStripThickness; | 268 return kOverflowStripThickness; |
| 276 } | 269 } |
| 277 | 270 |
| 278 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { | 271 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { |
| 279 panel_mouse_watcher_.reset(watcher); | 272 panel_mouse_watcher_.reset(watcher); |
| 280 } | 273 } |
| OLD | NEW |