Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: chrome/browser/ui/panels/panel_manager.cc

Issue 9517010: Change panels to be able to turn off autoresize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ensure that the latest version is uploaded. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(
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_);
jennb 2012/02/29 19:46:00 Could one of these update-preferred-size IPCs been
levin 2012/02/29 23:48:28 This is an important concern. It is handled here:
178 LOG(INFO) << "Resizing auto-resizable Panels is not supported yet."; 178 docked_strip_->ResizePanelWindow(panel, preferred_window_size,
179 return; 179 PanelStrip::AUTORESIZE_ENABLED);
180 }
181 docked_strip_->ResizePanelWindow(panel, preferred_window_size);
182 } 180 }
183 181
184 void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) { 182 void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) {
185 // Explicit resizing is not allowed for auto-resizable panels for now. 183 docked_strip_->ResizePanelWindow(panel, new_size,
jennb 2012/02/29 19:46:00 Is it safe to separate this like this: docked_str
levin 2012/02/29 23:48:28 Good call. Done.
186 // http://crbug.com/109343 184 PanelStrip::AUTORESIZE_DISABLED);
187 if (panel->auto_resizable())
188 return;
189
190 docked_strip_->ResizePanelWindow(panel, new_size);
191 } 185 }
192 186
193 bool PanelManager::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const { 187 bool PanelManager::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const {
194 return docked_strip_->ShouldBringUpTitlebars(mouse_x, mouse_y); 188 return docked_strip_->ShouldBringUpTitlebars(mouse_x, mouse_y);
195 } 189 }
196 190
197 void PanelManager::BringUpOrDownTitlebars(bool bring_up) { 191 void PanelManager::BringUpOrDownTitlebars(bool bring_up) {
198 docked_strip_->BringUpOrDownTitlebars(bring_up); 192 docked_strip_->BringUpOrDownTitlebars(bring_up);
199 } 193 }
200 194
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 return panels; 265 return panels;
272 } 266 }
273 267
274 int PanelManager::overflow_strip_width() const { 268 int PanelManager::overflow_strip_width() const {
275 return kOverflowStripThickness; 269 return kOverflowStripThickness;
276 } 270 }
277 271
278 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) { 272 void PanelManager::SetMouseWatcher(PanelMouseWatcher* watcher) {
279 panel_mouse_watcher_.reset(watcher); 273 panel_mouse_watcher_.reset(watcher);
280 } 274 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698