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

Unified Diff: chrome/browser/ui/browser.cc

Issue 10905301: Switch CoreTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_adoption.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 044cf017b77b4c91f9d511f0673d5f3e3a8cdb1a..3ebab50f3bb808d3fb41efe49bcda673f3435a95 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1105,7 +1105,8 @@ void Browser::ActiveTabChanged(TabContents* old_contents,
// Show the loading state (if any).
status_bubble->SetStatus(
- chrome::GetActiveTabContents(this)->core_tab_helper()->GetStatusText());
+ CoreTabHelper::FromWebContents(chrome::GetActiveWebContents(this))->
+ GetStatusText());
}
if (HasFindBarController()) {
@@ -1320,7 +1321,7 @@ void Browser::LoadingStateChanged(WebContents* source) {
command_controller_->LoadingStateChanged(is_loading, false);
if (GetStatusBubble()) {
GetStatusBubble()->SetStatus(
- chrome::GetActiveTabContents(this)->core_tab_helper()->
+ CoreTabHelper::FromWebContents(chrome::GetActiveWebContents(this))->
GetStatusText());
}
}
@@ -1701,18 +1702,19 @@ void Browser::RequestMediaAccessPermission(
///////////////////////////////////////////////////////////////////////////////
// Browser, CoreTabHelperDelegate implementation:
-void Browser::SwapTabContents(TabContents* old_tab_contents,
- TabContents* new_tab_contents) {
- int index = tab_strip_model_->GetIndexOfTabContents(old_tab_contents);
+void Browser::SwapTabContents(content::WebContents* old_contents,
+ content::WebContents* new_contents) {
+ int index = tab_strip_model_->GetIndexOfWebContents(old_contents);
DCHECK_NE(TabStripModel::kNoTab, index);
+ TabContents* new_tab_contents = TabContents::FromWebContents(new_contents);
tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents);
}
-bool Browser::CanReloadContents(TabContents* source) const {
+bool Browser::CanReloadContents(content::WebContents* web_contents) const {
return chrome::CanReload(this);
}
-bool Browser::CanSaveContents(TabContents* source) const {
+bool Browser::CanSaveContents(content::WebContents* web_contents) const {
return chrome::CanSavePage(this);
}
@@ -2006,8 +2008,9 @@ void Browser::ProcessPendingUIUpdates() {
}
// Updating the URL happens synchronously in ScheduleUIUpdate.
if (flags & content::INVALIDATE_TYPE_LOAD && GetStatusBubble()) {
- GetStatusBubble()->SetStatus(chrome::GetActiveTabContents(this)->
- core_tab_helper()->GetStatusText());
+ GetStatusBubble()->SetStatus(
+ CoreTabHelper::FromWebContents(chrome::GetActiveWebContents(this))->
+ GetStatusText());
}
if (flags & (content::INVALIDATE_TYPE_TAB |
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_adoption.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698