Index: chrome/browser/ui/cocoa/browser_window_controller.mm |
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm |
index c4205301f799e87d52ba2ceacf4e8451191d9afc..d27cb4a0fc98c3c1c4ef0fb9c3a18cd588c026ef 100644 |
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm |
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm |
@@ -61,6 +61,7 @@ |
#import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h" |
#import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h" |
#import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" |
+#import "chrome/browser/ui/cocoa/sidebar_controller.h" |
#import "chrome/browser/ui/cocoa/status_bubble_mac.h" |
#import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
#import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" |
@@ -313,6 +314,12 @@ using content::WebContents; |
[[devToolsController_ view] |
addSubview:[overlayableContentsController_ view]]; |
+ // Create a sub-controller for the docked sidebar and add its view to the |
+ // hierarchy. |
+ sidebarController_.reset([[SidebarController alloc] |
+ initWithParentViewController:devToolsController_ |
+ andContentsController:overlayableContentsController_]); |
+ |
// Create a controller for the tab strip, giving it the model object for |
// this window's Browser and the tab strip view. The controller will handle |
// registering for the appropriate tab notifications from the back-end and |
@@ -557,6 +564,14 @@ using content::WebContents; |
[self layoutSubviews]; |
} |
+ |
+- (void)updateSidebarForContents:(content::WebContents*)tab_contents |
+ sidebar_contents:(content::WebContents*)sidebar_contents { |
+ [sidebarController_ updateSidebarForTabContents:tab_contents |
+ sidebar_contents:sidebar_contents]; |
+ [sidebarController_ ensureContentsVisible]; |
+} |
+ |
// Called when the user wants to close a window or from the shutdown process. |
// The Browser object is in control of whether or not we're allowed to close. It |
// may defer closing due to several states, such as onUnload handlers needing to |
@@ -1487,6 +1502,9 @@ using content::WebContents; |
// Update all the UI bits. |
windowShim_->UpdateTitleBar(); |
+ [sidebarController_ |
+ updateSidebarForTabContents:static_cast<content::WebContents*>(contents) |
+ sidebar_contents:[sidebarController_ currentSidebarContents]]; |
// Update the bookmark bar. |
// TODO(viettrungluu): perhaps update to not terminate running animations (if |
// applicable)? |
@@ -1495,6 +1513,9 @@ using content::WebContents; |
[infoBarContainerController_ changeWebContents:contents]; |
+ // Update devTools and sidebar contents after size for all views is set. |
+ [sidebarController_ ensureContentsVisible]; |
+ |
// Must do this after bookmark and infobar updates to avoid |
// unnecesary resize in contents. |
[devToolsController_ updateDevToolsForWebContents:contents |