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

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

Issue 2149973002: Remove embeddedSearch.searchBox.displayInstantResults (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@searchbox_applauncher
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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_ipc_router.h" 5 #include "chrome/browser/ui/search/search_ipc_router.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search/search.h" 10 #include "chrome/browser/search/search.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 identity_match)); 47 identity_match));
48 } 48 }
49 49
50 void SearchIPCRouter::SendHistorySyncCheckResult(bool sync_history) { 50 void SearchIPCRouter::SendHistorySyncCheckResult(bool sync_history) {
51 if (!policy_->ShouldProcessHistorySyncCheck()) 51 if (!policy_->ShouldProcessHistorySyncCheck())
52 return; 52 return;
53 53
54 Send(new ChromeViewMsg_HistorySyncCheckResult(routing_id(), sync_history)); 54 Send(new ChromeViewMsg_HistorySyncCheckResult(routing_id(), sync_history));
55 } 55 }
56 56
57 void SearchIPCRouter::SetDisplayInstantResults() {
58 if (!policy_->ShouldSendSetDisplayInstantResults())
59 return;
60
61 bool is_search_results_page = !search::GetSearchTerms(web_contents()).empty();
62 bool display_instant_results =
63 is_search_results_page ? search::ShouldPrefetchSearchResultsOnSRP()
64 : search::ShouldPrefetchSearchResults();
65 Send(new ChromeViewMsg_SearchBoxSetDisplayInstantResults(
66 routing_id(), display_instant_results));
67 }
68
69 void SearchIPCRouter::SetSuggestionToPrefetch( 57 void SearchIPCRouter::SetSuggestionToPrefetch(
70 const InstantSuggestion& suggestion) { 58 const InstantSuggestion& suggestion) {
71 if (!policy_->ShouldSendSetSuggestionToPrefetch()) 59 if (!policy_->ShouldSendSetSuggestionToPrefetch())
72 return; 60 return;
73 61
74 Send(new ChromeViewMsg_SearchBoxSetSuggestionToPrefetch(routing_id(), 62 Send(new ChromeViewMsg_SearchBoxSetSuggestionToPrefetch(routing_id(),
75 suggestion)); 63 suggestion));
76 } 64 }
77 65
78 void SearchIPCRouter::SetInputInProgress(bool input_in_progress) { 66 void SearchIPCRouter::SetInputInProgress(bool input_in_progress) {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 279
292 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { 280 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) {
293 DCHECK(delegate); 281 DCHECK(delegate);
294 delegate_ = delegate; 282 delegate_ = delegate;
295 } 283 }
296 284
297 void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) { 285 void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) {
298 DCHECK(policy.get()); 286 DCHECK(policy.get());
299 policy_.reset(policy.release()); 287 policy_.reset(policy.release());
300 } 288 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_ipc_router.h ('k') | chrome/browser/ui/search/search_ipc_router_policy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698