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

Unified Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 10944016: Switch SearchTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const 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/views/tabs/browser_tab_strip_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 0ddd48da12b47e6c85f235eb32bb54cb3567034b..fe5584f129311599076af9626c42efedf99708ba 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -417,14 +417,14 @@ void BrowserTabStripController::TabChangedAt(TabContents* contents,
return;
}
- SetTabDataAt(contents, model_index);
+ SetTabDataAt(contents->web_contents(), model_index);
}
void BrowserTabStripController::TabReplacedAt(TabStripModel* tab_strip_model,
TabContents* old_contents,
TabContents* new_contents,
int model_index) {
- SetTabDataAt(new_contents, model_index);
+ SetTabDataAt(new_contents->web_contents(), model_index);
}
void BrowserTabStripController::TabPinnedStateChanged(
@@ -433,16 +433,14 @@ void BrowserTabStripController::TabPinnedStateChanged(
// Currently none of the renderers render pinned state differently.
}
-void BrowserTabStripController::TabMiniStateChanged(
- TabContents* contents,
- int model_index) {
- SetTabDataAt(contents, model_index);
+void BrowserTabStripController::TabMiniStateChanged(TabContents* contents,
+ int model_index) {
+ SetTabDataAt(contents->web_contents(), model_index);
}
-void BrowserTabStripController::TabBlockedStateChanged(
- TabContents* contents,
- int model_index) {
- SetTabDataAt(contents, model_index);
+void BrowserTabStripController::TabBlockedStateChanged(TabContents* contents,
+ int model_index) {
+ SetTabDataAt(contents->web_contents(), model_index);
}
////////////////////////////////////////////////////////////////////////////////
@@ -455,7 +453,7 @@ void BrowserTabStripController::ModeChanged(
// repainting of tab's background.
int active_index = GetActiveIndex();
DCHECK_NE(active_index, -1);
- SetTabDataAt(chrome::GetTabContentsAt(browser_, active_index), active_index);
+ SetTabDataAt(chrome::GetWebContentsAt(browser_, active_index), active_index);
}
////////////////////////////////////////////////////////////////////////////////
@@ -467,11 +465,11 @@ void BrowserTabStripController::OnToolbarBackgroundAnimatorProgressed() {
// background.
int active_index = GetActiveIndex();
DCHECK_NE(active_index, -1);
- SetTabDataAt(chrome::GetTabContentsAt(browser_, active_index), active_index);
+ SetTabDataAt(chrome::GetWebContentsAt(browser_, active_index), active_index);
}
void BrowserTabStripController::OnToolbarBackgroundAnimatorCanceled(
- TabContents* tab_contents) {
+ content::WebContents* web_contents) {
// Fade in of tab background has been canceled, which can happen in 2
// scenarios:
// 1) a deactivated or detached or closing tab, whose |tab_contents| is the
@@ -481,12 +479,12 @@ void BrowserTabStripController::OnToolbarBackgroundAnimatorCanceled(
// If we proceed, set tab data so that
// |TabRendererData::gradient_background_opacity| will be reset.
// Repainting of tab's background will be triggered in the process.
- int index = tab_contents ? model_->GetIndexOfTabContents(tab_contents) :
+ int index = web_contents ? model_->GetIndexOfWebContents(web_contents) :
GetActiveIndex();
if (index == -1)
return;
- SetTabDataAt(tab_contents ? tab_contents :
- chrome::GetTabContentsAt(browser_, index), index);
+ SetTabDataAt(web_contents ? web_contents :
+ chrome::GetWebContentsAt(browser_, index), index);
}
////////////////////////////////////////////////////////////////////////////////
@@ -534,12 +532,10 @@ void BrowserTabStripController::SetTabRendererDataFromModel(
toolbar_search_animator().GetGradientOpacity();
}
-void BrowserTabStripController::SetTabDataAt(
- TabContents* contents,
- int model_index) {
+void BrowserTabStripController::SetTabDataAt(content::WebContents* web_contents,
+ int model_index) {
TabRendererData data;
- SetTabRendererDataFromModel(contents->web_contents(), model_index, &data,
- EXISTING_TAB);
+ SetTabRendererDataFromModel(web_contents, model_index, &data, EXISTING_TAB);
tabstrip_->SetTabData(model_index, data);
}
« no previous file with comments | « chrome/browser/ui/views/tabs/browser_tab_strip_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698