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

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

Issue 440663003: DevTools: remove unused resizing strategy code paths, make it solely bounds-based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for landing Created 6 years, 4 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 | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('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 d8722bf6e3e8eadcc3196b24e2dd538dc8c939f1..8236fd76be896b614708b496d73b0f46e00deda1 100644
--- a/chrome/browser/ui/cocoa/dev_tools_controller.mm
+++ b/chrome/browser/ui/cocoa/dev_tools_controller.mm
@@ -43,13 +43,16 @@ using content::WebContents;
- (void)setDevToolsView:(NSView*)devToolsView
withStrategy:(const DevToolsContentsResizingStrategy&)strategy {
strategy_.CopyFrom(strategy);
-
- if (devToolsView == devToolsView_)
+ if (devToolsView == devToolsView_) {
+ if (contentsView_)
+ [contentsView_ setHidden:strategy.hide_inspected_contents()];
return;
+ }
if (devToolsView_) {
DCHECK_EQ(2u, [[self subviews] count]);
[devToolsView_ removeFromSuperview];
+ [contentsView_ setHidden:NO];
contentsView_ = nil;
devToolsView_ = nil;
}
@@ -61,6 +64,8 @@ using content::WebContents;
devToolsView_ = devToolsView;
// Place DevTools under contents.
[self addSubview:devToolsView positioned:NSWindowBelow relativeTo:nil];
+
+ [contentsView_ setHidden:strategy.hide_inspected_contents()];
}
}
@@ -89,8 +94,6 @@ using content::WebContents;
gfx::Rect new_contents_bounds;
ApplyDevToolsContentsResizingStrategy(
strategy_, gfx::Size(NSSizeToCGSize([self bounds].size)),
- [self flipNSRectToRect:[devToolsView_ bounds]],
- [self flipNSRectToRect:[contentsView_ bounds]],
&new_devtools_bounds, &new_contents_bounds);
[devToolsView_ setFrame:[self flipRectToNSRect:new_devtools_bounds]];
[contentsView_ setFrame:[self flipRectToNSRect:new_contents_bounds]];
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698