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

Unified Diff: chrome/browser/ui/cocoa/dev_tools_controller.mm

Issue 12226086: Alternate NTP: Fix dev tools layout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/dev_tools_controller_browsertest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/dev_tools_controller.mm
diff --git a/chrome/browser/ui/cocoa/dev_tools_controller.mm b/chrome/browser/ui/cocoa/dev_tools_controller.mm
index ba97641273cc204ed1f0cf26662fe8aa91aacda4..f16c33ab65bc38dde42d100129690cdb466bde25 100644
--- a/chrome/browser/ui/cocoa/dev_tools_controller.mm
+++ b/chrome/browser/ui/cocoa/dev_tools_controller.mm
@@ -55,27 +55,6 @@ using content::WebContents;
@end
-// Superview for the dev tools contents view. This class ensures that dev tools
-// view doesn't overlap the toolbar when split vertically.
-@interface DevToolsContainerView : NSView
-@end
-
-@implementation DevToolsContainerView
-
-- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
- NSRect subviewFrame = [self bounds];
- GraySplitView* splitView =
- base::mac::ObjCCastStrict<GraySplitView>([self superview]);
- if ([splitView isVertical])
- subviewFrame.size.height -= [splitView topContentOffset];
-
- DCHECK_EQ(1u, [[self subviews] count]);
- [[[self subviews] lastObject] setFrame:subviewFrame];
-}
-
-@end
-
-
@interface DevToolsController (Private)
- (void)showDevToolsContainer;
- (void)hideDevToolsContainer;
@@ -163,8 +142,17 @@ using content::WebContents;
NSView* devToolsView = devToolsContents->GetNativeView();
view_id_util::SetID(devToolsView, VIEW_ID_DEV_TOOLS_DOCKED);
- scoped_nsobject<DevToolsContainerView> devToolsContainerView(
- [[DevToolsContainerView alloc] initWithFrame:[devToolsView bounds]]);
+ NSRect containerRect = NSMakeRect(0, 0, 100, 100);
+ scoped_nsobject<NSView> devToolsContainerView(
+ [[NSView alloc] initWithFrame:containerRect]);
+
+ NSRect devToolsRect = containerRect;
+ if (devToolsWindow_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT) {
+ devToolsRect.size.height -= [splitView_ topContentOffset];
+ }
+ [devToolsView setFrame:devToolsRect];
+ [devToolsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+
[devToolsContainerView addSubview:devToolsView];
[splitView_ addSubview:devToolsContainerView];
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/dev_tools_controller_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698