Switch BookmarkTabHelper to use WebContentsUserData.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.appspot.com/10945010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157456 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 2d4c48c..3a4be68a 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -946,10 +946,9 @@
}
void BrowserCommandController::UpdateCommandsForTabState() {
- TabContents* current_tab_contents = chrome::GetActiveTabContents(browser_);
- if (!current_tab_contents) // May be NULL during tab restore.
+ WebContents* current_web_contents = chrome::GetActiveWebContents(browser_);
+ if (!current_web_contents) // May be NULL during tab restore.
return;
- WebContents* current_web_contents = current_tab_contents->web_contents();
// Navigation commands
command_updater_.UpdateCommandEnabled(IDC_BACK, CanGoBack(browser_));
@@ -966,7 +965,7 @@
// Page-related commands
window()->SetStarredState(
- current_tab_contents->bookmark_tab_helper()->is_starred());
+ BookmarkTabHelper::FromWebContents(current_web_contents)->is_starred());
window()->ZoomChangedForActiveTab(false);
command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
CanViewSource(browser_));