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