Index: chrome/browser/ui/cocoa/sidebar_controller.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/sidebar_controller.mm (revision 74134) |
+++ chrome/browser/ui/cocoa/sidebar_controller.mm (working copy) |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/sidebar/sidebar_manager.h" |
#include "chrome/browser/tab_contents/tab_contents.h" |
#import "chrome/browser/ui/cocoa/view_id_util.h" |
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
#include "chrome/common/pref_names.h" |
namespace { |
@@ -63,15 +64,17 @@ |
return splitView_.get(); |
} |
-- (void)updateSidebarForTabContents:(TabContents*)contents { |
+- (void)updateSidebarForTab:(TabContentsWrapper*)tab { |
// Get the active sidebar content. |
if (SidebarManager::GetInstance() == NULL) // Happens in tests. |
return; |
+ TabContents* contents = tab ? tab->tab_contents() : NULL; |
+ |
TabContents* sidebarContents = NULL; |
if (contents && SidebarManager::IsSidebarAllowed()) { |
SidebarContainer* activeSidebar = |
- SidebarManager::GetInstance()->GetActiveSidebarContainerFor(contents); |
+ SidebarManager::GetInstance()->GetActiveSidebarContainerFor(tab); |
if (activeSidebar) |
sidebarContents = activeSidebar->sidebar_contents(); |
} |
@@ -101,9 +104,9 @@ |
// Native view is a TabContentsViewCocoa object, whose ViewID was |
// set to VIEW_ID_TAB_CONTAINER initially, so change it to |
- // VIEW_ID_SIDE_BAR_CONTAINER here. |
+ // VIEW_ID_SIDEBAR_CONTAINER here. |
view_id_util::SetID( |
- sidebarContents->GetNativeView(), VIEW_ID_SIDE_BAR_CONTAINER); |
+ sidebarContents->GetNativeView(), VIEW_ID_SIDEBAR_CONTAINER); |
CGFloat sidebarWidth = 0; |
if ([subviews count] == 1) { |