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

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

Issue 294903014: [DevTools] Add toolbox web contents to show in undocked mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 6 years, 7 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
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 5d65f1e4b0645de301f972bbd7120e0f01ce3c68..9ce194040d992c6359fddc164f257c7248d8da95 100644
--- a/chrome/browser/ui/cocoa/dev_tools_controller.mm
+++ b/chrome/browser/ui/cocoa/dev_tools_controller.mm
@@ -116,22 +116,21 @@ using content::WebContents;
- (void)updateDevToolsForWebContents:(WebContents*)contents
withProfile:(Profile*)profile {
- DevToolsWindow* newDevToolsWindow = contents ?
- DevToolsWindow::GetDockedInstanceForInspectedTab(contents) : NULL;
+ DevToolsContentsResizingStrategy strategy;
+ WebContents* devTools = DevToolsWindow::GetInTabWebContents(
+ contents, &strategy);
// Make sure we do not draw any transient arrangements of views.
gfx::ScopedNSDisableScreenUpdates disabler;
- bool shouldHide = devToolsWindow_ && devToolsWindow_ != newDevToolsWindow;
- bool shouldShow = newDevToolsWindow && devToolsWindow_ != newDevToolsWindow;
+ bool shouldHide = devTools_ && devTools_ != devTools;
+ bool shouldShow = devTools && devTools_ != devTools;
if (shouldHide)
[self hideDevToolsView];
- devToolsWindow_ = newDevToolsWindow;
- if (devToolsWindow_) {
- const DevToolsContentsResizingStrategy& strategy =
- devToolsWindow_->GetContentsResizingStrategy();
- devToolsWindow_->web_contents()->SetOverlayView(
+ devTools_ = devTools;
+ if (devTools_) {
+ devTools_->SetOverlayView(
contents,
gfx::Point(strategy.insets().left(), strategy.insets().top()));
[devToolsContainerView_ setContentsResizingStrategy:strategy];
@@ -153,14 +152,14 @@ using content::WebContents;
// |devToolsView| is a WebContentsViewCocoa object, whose ViewID was
// set to VIEW_ID_TAB_CONTAINER initially, so we need to change it to
// VIEW_ID_DEV_TOOLS_DOCKED here.
- NSView* devToolsView = devToolsWindow_->web_contents()->GetNativeView();
+ NSView* devToolsView = devTools_->GetNativeView();
view_id_util::SetID(devToolsView, VIEW_ID_DEV_TOOLS_DOCKED);
[devToolsContainerView_ showDevTools:devToolsView];
}
- (void)hideDevToolsView {
- devToolsWindow_->web_contents()->RemoveOverlayView();
+ devTools_->RemoveOverlayView();
[devToolsContainerView_ hideDevTools];
[focusTracker_ restoreFocusInWindow:[devToolsContainerView_ window]];
focusTracker_.reset();

Powered by Google App Engine
This is Rietveld 408576698