| 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_)
|
| - 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) {
|
|
|