| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/search/search_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 318 } |
| 319 | 319 |
| 320 void SearchTabHelper::NavigationEntryCommitted( | 320 void SearchTabHelper::NavigationEntryCommitted( |
| 321 const content::LoadCommittedDetails& load_details) { | 321 const content::LoadCommittedDetails& load_details) { |
| 322 if (!is_search_enabled_) | 322 if (!is_search_enabled_) |
| 323 return; | 323 return; |
| 324 | 324 |
| 325 if (!load_details.is_main_frame) | 325 if (!load_details.is_main_frame) |
| 326 return; | 326 return; |
| 327 | 327 |
| 328 if (search::ShouldAssignURLToInstantRenderer(web_contents_->GetURL(), | |
| 329 profile())) | |
| 330 ipc_router_.SetDisplayInstantResults(); | |
| 331 | |
| 332 UpdateMode(true); | 328 UpdateMode(true); |
| 333 | 329 |
| 334 content::NavigationEntry* entry = | 330 content::NavigationEntry* entry = |
| 335 web_contents_->GetController().GetVisibleEntry(); | 331 web_contents_->GetController().GetVisibleEntry(); |
| 336 DCHECK(entry); | 332 DCHECK(entry); |
| 337 | 333 |
| 338 // Already determined the instant support state for this page, do not reset | 334 // Already determined the instant support state for this page, do not reset |
| 339 // the instant support state. | 335 // the instant support state. |
| 340 if (load_details.is_in_page) { | 336 if (load_details.is_in_page) { |
| 341 // When an "in-page" navigation happens, we will not receive a | 337 // When an "in-page" navigation happens, we will not receive a |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 557 |
| 562 bool SearchTabHelper::IsInputInProgress() const { | 558 bool SearchTabHelper::IsInputInProgress() const { |
| 563 OmniboxView* omnibox = GetOmniboxView(); | 559 OmniboxView* omnibox = GetOmniboxView(); |
| 564 return !model_.mode().is_ntp() && omnibox && | 560 return !model_.mode().is_ntp() && omnibox && |
| 565 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 561 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
| 566 } | 562 } |
| 567 | 563 |
| 568 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 564 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
| 569 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 565 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
| 570 } | 566 } |
| OLD | NEW |