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

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

Issue 10816027: alternate ntp: toolbar background and separator animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android build break Created 8 years, 4 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') | chrome/browser/ui/views/tabs/tab.cc » ('j') | 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 dd7b8ccaa75af398829a9be96359a1a447e59c36..d101fc1e0e215af8dbc5420859d8d369ef7e32a6 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -443,7 +443,9 @@ void BrowserTabStripController::TabBlockedStateChanged(
////////////////////////////////////////////////////////////////////////////////
// BrowserTabStripController, chrome::search::SearchModelObserver:
-void BrowserTabStripController::ModeChanged(const chrome::search::Mode& mode) {
+void BrowserTabStripController::ModeChanged(
+ const chrome::search::Mode& old_mode,
+ const chrome::search::Mode& new_mode) {
// Mode has changed, set tab data based on new mode, which will trigger
// repainting of tab's background.
int active_index = GetActiveIndex();
@@ -471,8 +473,8 @@ void BrowserTabStripController::OnToolbarBackgroundAnimatorCanceled(
// the formal parameter: make sure |tab_contents| still exist in tab model.
// 2) mode change of active tab, as indicated by a NULL |tab_contents|: make
// sure active tab exists, and retrieve its |tab_contents|.
- // If we proceed, set tab data so that |TabRendererData::background_state| and
- // |TabRendererData::search_background_opacity| will be reset.
+ // 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) :
GetActiveIndex();
@@ -523,18 +525,9 @@ void BrowserTabStripController::SetTabRendererDataFromModel(
data->blocked = model_->IsTabBlocked(model_index);
data->app = tab_contents->extension_tab_helper()->is_app();
data->mode = browser_->search_model()->mode().mode;
- if (data->mode == chrome::search::Mode::MODE_SEARCH) {
- // Get current state of background animation to paint for SEARCH mode.
- browser_->search_delegate()->toolbar_search_animator().
- GetCurrentBackgroundState(&data->background_state,
- &data->search_background_opacity);
- } else {
- data->background_state =
- chrome::search::ToolbarSearchAnimator::BACKGROUND_STATE_DEFAULT;
- // Valid opacity value of double data type is 0f to 1f, so use -1f to
- // indicate an invalid value.
- data->search_background_opacity = -1.0f;
- }
+ // Get current gradient background animation to paint.
+ data->gradient_background_opacity = browser_->search_delegate()->
+ toolbar_search_animator().GetGradientOpacity();
}
void BrowserTabStripController::SetTabDataAt(
« no previous file with comments | « chrome/browser/ui/views/tabs/browser_tab_strip_controller.h ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698