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

Side by Side Diff: chrome/browser/ui/cocoa/dev_tools_controller.mm

Issue 12871013: DevTools: respect minimum width/height when resizing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 #import "chrome/browser/ui/cocoa/dev_tools_controller.h" 5 #import "chrome/browser/ui/cocoa/dev_tools_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include <Cocoa/Cocoa.h> 9 #include <Cocoa/Cocoa.h>
10 10
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 - (CGFloat)splitView:(NSSplitView*)splitView 222 - (CGFloat)splitView:(NSSplitView*)splitView
223 constrainSplitPosition:(CGFloat)proposedPosition 223 constrainSplitPosition:(CGFloat)proposedPosition
224 ofSubviewAt:(NSInteger)dividerIndex { 224 ofSubviewAt:(NSInteger)dividerIndex {
225 if (![splitView_ isVertical] && 225 if (![splitView_ isVertical] &&
226 proposedPosition < [splitView_ topContentOffset]) { 226 proposedPosition < [splitView_ topContentOffset]) {
227 return [splitView_ topContentOffset]; 227 return [splitView_ topContentOffset];
228 } 228 }
229 return proposedPosition; 229 return proposedPosition;
230 } 230 }
231 231
232 - (CGFloat)splitView:(NSSplitView *)splitView
Avi (use Gerrit) 2013/03/19 14:43:23 no space before *
dgozman 2013/03/21 09:55:26 Done.
dgozman 2013/03/21 09:55:26 Done.
233 constrainMaxCoordinate:(CGFloat)proposedMax
234 ofSubviewAt:(NSInteger)dividerIndex {
Avi (use Gerrit) 2013/03/19 14:43:23 If you need to indent the "constrain" line, OK, bu
dgozman 2013/03/21 09:55:26 I did as in method above. Also, style guide sugges
235 if ([splitView_ isVertical]) {
236 return NSWidth([splitView_ frame]) - [splitView_ dividerThickness] -
237 devToolsWindow_->GetMinimumWidth();
238 } else {
239 return NSHeight([splitView_ frame]) - [splitView_ dividerThickness] -
240 devToolsWindow_->GetMinimumHeight();
241 }
242 }
243
232 -(void)splitViewWillResizeSubviews:(NSNotification *)notification { 244 -(void)splitViewWillResizeSubviews:(NSNotification *)notification {
233 [[splitView_ window] disableScreenUpdatesUntilFlush]; 245 [[splitView_ window] disableScreenUpdatesUntilFlush];
234 } 246 }
235 247
236 @end 248 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698