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

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

Issue 10816027: alternate ntp: toolbar background and separator animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comments Created 8 years, 5 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
Index: chrome/browser/ui/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index efccd6fca51dba311b5c76f5803bbf6f049e3037..42c7dd5bd2fb343b092e2ccf628d019f508987d2 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -91,7 +91,7 @@ void SearchTabHelper::NavigateToPendingEntry(
if (!is_search_enabled_)
return;
- UpdateModel(url);
+ UpdateModel(url, !web_contents()->GetController().IsInitialNavigation());
FlushNTP(url);
}
@@ -102,17 +102,18 @@ void SearchTabHelper::Observe(
DCHECK_EQ(content::NOTIFICATION_NAV_ENTRY_COMMITTED, type);
content::LoadCommittedDetails* committed_details =
content::Details<content::LoadCommittedDetails>(details).ptr();
- UpdateModel(committed_details->entry->GetURL());
+ UpdateModel(committed_details->entry->GetURL(),
+ web_contents()->GetController().IsInitialNavigation());
FlushNTP(committed_details->entry->GetURL());
}
-void SearchTabHelper::UpdateModel(const GURL& url) {
+void SearchTabHelper::UpdateModel(const GURL& url, bool animate) {
Mode::Type type = Mode::MODE_DEFAULT;
if (IsNTP(url))
type = Mode::MODE_NTP;
else if (google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec()))
type = Mode::MODE_SEARCH;
- model_.SetMode(Mode(type, true));
+ model_.SetMode(Mode(type, animate));
}
void SearchTabHelper::FlushNTP(const GURL& url) {

Powered by Google App Engine
This is Rietveld 408576698