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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents_); | 212 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents_); |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 void SearchTabHelper::OnTabDeactivated() { | 216 void SearchTabHelper::OnTabDeactivated() { |
217 ipc_router_.OnTabDeactivated(); | 217 ipc_router_.OnTabDeactivated(); |
218 } | 218 } |
219 | 219 |
220 void SearchTabHelper::DidStartNavigationToPendingEntry( | 220 void SearchTabHelper::DidStartNavigationToPendingEntry( |
221 const GURL& url, | 221 const GURL& url, |
222 content::NavigationController::ReloadType /* reload_type */) { | 222 content::ReloadType /* reload_type */) { |
223 if (search::IsNTPURL(url, profile())) { | 223 if (search::IsNTPURL(url, profile())) { |
224 // Set the title on any pending entry corresponding to the NTP. This | 224 // Set the title on any pending entry corresponding to the NTP. This |
225 // prevents any flickering of the tab title. | 225 // prevents any flickering of the tab title. |
226 content::NavigationEntry* entry = | 226 content::NavigationEntry* entry = |
227 web_contents_->GetController().GetPendingEntry(); | 227 web_contents_->GetController().GetPendingEntry(); |
228 if (entry) { | 228 if (entry) { |
229 web_contents_->UpdateTitleForEntry( | 229 web_contents_->UpdateTitleForEntry( |
230 entry, l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); | 230 entry, l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); |
231 } | 231 } |
232 } | 232 } |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 | 501 |
502 bool SearchTabHelper::IsInputInProgress() const { | 502 bool SearchTabHelper::IsInputInProgress() const { |
503 OmniboxView* omnibox = GetOmniboxView(); | 503 OmniboxView* omnibox = GetOmniboxView(); |
504 return !model_.mode().is_ntp() && omnibox && | 504 return !model_.mode().is_ntp() && omnibox && |
505 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 505 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
506 } | 506 } |
507 | 507 |
508 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 508 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
509 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 509 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
510 } | 510 } |
OLD | NEW |