Chromium Code Reviews| 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) { |