| 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..159e8c8f1fb6eea5baad13926accbe2fbb629f3d 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::GetWebContentsToShowForInspectedTab(
|
| + 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();
|
|
|