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

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

Issue 12285005: Merge 182499 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/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
===================================================================
--- chrome/browser/ui/cocoa/dev_tools_controller.mm (revision 182776)
+++ chrome/browser/ui/cocoa/dev_tools_controller.mm (working copy)
@@ -59,6 +59,7 @@
- (void)showDevToolsContainer;
- (void)hideDevToolsContainer;
- (void)updateDevToolsSplitPosition;
+- (void)updateDevToolsViewFrame;
@end
@@ -129,6 +130,8 @@
- (void)setTopContentOffset:(CGFloat)offset {
[splitView_ setTopContentOffset:offset];
+ if ([[splitView_ subviews] count] > 1)
+ [self updateDevToolsViewFrame];
}
- (void)showDevToolsContainer {
@@ -141,20 +144,14 @@
// VIEW_ID_DEV_TOOLS_DOCKED here.
NSView* devToolsView = devToolsContents->GetNativeView();
view_id_util::SetID(devToolsView, VIEW_ID_DEV_TOOLS_DOCKED);
+ [devToolsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
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];
+ [self updateDevToolsViewFrame];
BOOL isVertical = devToolsWindow_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT;
[splitView_ setVertical:isVertical];
@@ -200,6 +197,14 @@
[splitView_ adjustSubviews];
}
+- (void)updateDevToolsViewFrame {
+ NSView* devToolsView = devToolsWindow_->web_contents()->GetNativeView();
+ NSRect devToolsRect = [[devToolsView superview] bounds];
+ if (devToolsWindow_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT)
+ devToolsRect.size.height -= [splitView_ topContentOffset];
+ [devToolsView setFrame:devToolsRect];
+}
+
// NSSplitViewDelegate protocol.
- (BOOL)splitView:(NSSplitView *)splitView
shouldAdjustSizeOfSubview:(NSView *)subview {
« 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