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

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

Issue 24940002: Send ChromeViewMsg_SearchBoxSetSuggestionToPrefetch IPC message from SearchIPCRouter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comment Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_ipc_sender.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/instant_controller.h" 5 #include "chrome/browser/ui/search/instant_controller.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (omnibox_bounds_ == bounds) 118 if (omnibox_bounds_ == bounds)
119 return; 119 return;
120 120
121 omnibox_bounds_ = bounds; 121 omnibox_bounds_ = bounds;
122 if (instant_tab_) 122 if (instant_tab_)
123 instant_tab_->sender()->SetOmniboxBounds(omnibox_bounds_); 123 instant_tab_->sender()->SetOmniboxBounds(omnibox_bounds_);
124 } 124 }
125 125
126 void InstantController::SetSuggestionToPrefetch( 126 void InstantController::SetSuggestionToPrefetch(
127 const InstantSuggestion& suggestion) { 127 const InstantSuggestion& suggestion) {
128 if (instant_tab_ && search_mode_.is_search()) 128 if (instant_tab_ && search_mode_.is_search()) {
129 instant_tab_->sender()->SetSuggestionToPrefetch(suggestion); 129 SearchTabHelper::FromWebContents(instant_tab_->contents())->
130 SetSuggestionToPrefetch(suggestion);
131 }
130 } 132 }
131 133
132 void InstantController::ToggleVoiceSearch() { 134 void InstantController::ToggleVoiceSearch() {
133 if (instant_tab_) 135 if (instant_tab_)
134 instant_tab_->sender()->ToggleVoiceSearch(); 136 instant_tab_->sender()->ToggleVoiceSearch();
135 } 137 }
136 138
137 void InstantController::InstantPageLoadFailed(content::WebContents* contents) { 139 void InstantController::InstantPageLoadFailed(content::WebContents* contents) {
138 if (!chrome::ShouldPreferRemoteNTPOnStartup()) { 140 if (!chrome::ShouldPreferRemoteNTPOnStartup()) {
139 // We only need to fall back on errors if we're showing the online page 141 // We only need to fall back on errors if we're showing the online page
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 content::PAGE_TRANSITION_SERVER_REDIRECT, 397 content::PAGE_TRANSITION_SERVER_REDIRECT,
396 std::string()); // No extra headers. 398 std::string()); // No extra headers.
397 // TODO(dcblack): Remove extraneous history entry caused by 404s. 399 // TODO(dcblack): Remove extraneous history entry caused by 404s.
398 // Note that the base case of a 204 being returned doesn't push a history 400 // Note that the base case of a 204 being returned doesn't push a history
399 // entry. 401 // entry.
400 } 402 }
401 403
402 InstantService* InstantController::GetInstantService() const { 404 InstantService* InstantController::GetInstantService() const {
403 return InstantServiceFactory::GetForProfile(profile()); 405 return InstantServiceFactory::GetForProfile(profile());
404 } 406 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_ipc_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698