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

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: address dhollowa's comments 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
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..77facd53bf7f6fa115f0c7e97dfc65d8a75d331d 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -34,7 +34,8 @@ SearchTabHelper::SearchTabHelper(
bool is_search_enabled)
: WebContentsObserver(contents->web_contents()),
is_search_enabled_(is_search_enabled),
- model_(contents) {
+ model_(contents),
+ has_navigated_(false) {
if (!is_search_enabled)
return;
@@ -85,16 +86,6 @@ void SearchTabHelper::OmniboxEditModelChanged(OmniboxEditModel* edit_model) {
model_.SetMode(Mode(mode, true));
}
-void SearchTabHelper::NavigateToPendingEntry(
- const GURL& url,
- content::NavigationController::ReloadType reload_type) {
- if (!is_search_enabled_)
sky 2012/08/03 17:29:40 Are you sure removing this doesn't lead to flicker
kuan 2012/08/03 17:46:49 i tested lots of times, with different mode transi
- return;
-
- UpdateModel(url);
- FlushNTP(url);
-}
-
void SearchTabHelper::Observe(
int type,
const content::NotificationSource& source,
@@ -102,17 +93,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(), has_navigated_);
+ has_navigated_ = true;
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