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

Side by Side Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 2225343002: Navigation: move RestoreType and ReloadType into a separate file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+ Created 4 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 unified diff | Download patch
OLDNEW
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void SearchTabHelper::OnTabDeactivated() { 220 void SearchTabHelper::OnTabDeactivated() {
221 ipc_router_.OnTabDeactivated(); 221 ipc_router_.OnTabDeactivated();
222 } 222 }
223 223
224 bool SearchTabHelper::IsSearchResultsPage() { 224 bool SearchTabHelper::IsSearchResultsPage() {
225 return model_.mode().is_origin_search(); 225 return model_.mode().is_origin_search();
226 } 226 }
227 227
228 void SearchTabHelper::DidStartNavigationToPendingEntry( 228 void SearchTabHelper::DidStartNavigationToPendingEntry(
229 const GURL& url, 229 const GURL& url,
230 content::NavigationController::ReloadType /* reload_type */) { 230 content::ReloadType /* reload_type */) {
231 if (search::IsNTPURL(url, profile())) { 231 if (search::IsNTPURL(url, profile())) {
232 // Set the title on any pending entry corresponding to the NTP. This 232 // Set the title on any pending entry corresponding to the NTP. This
233 // prevents any flickering of the tab title. 233 // prevents any flickering of the tab title.
234 content::NavigationEntry* entry = 234 content::NavigationEntry* entry =
235 web_contents_->GetController().GetPendingEntry(); 235 web_contents_->GetController().GetPendingEntry();
236 if (entry) { 236 if (entry) {
237 web_contents_->UpdateTitleForEntry( 237 web_contents_->UpdateTitleForEntry(
238 entry, l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); 238 entry, l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
239 } 239 }
240 } 240 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 519
520 bool SearchTabHelper::IsInputInProgress() const { 520 bool SearchTabHelper::IsInputInProgress() const {
521 OmniboxView* omnibox = GetOmniboxView(); 521 OmniboxView* omnibox = GetOmniboxView();
522 return !model_.mode().is_ntp() && omnibox && 522 return !model_.mode().is_ntp() && omnibox &&
523 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; 523 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE;
524 } 524 }
525 525
526 OmniboxView* SearchTabHelper::GetOmniboxView() const { 526 OmniboxView* SearchTabHelper::GetOmniboxView() const {
527 return delegate_ ? delegate_->GetOmniboxView() : NULL; 527 return delegate_ ? delegate_->GetOmniboxView() : NULL;
528 } 528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698