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

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: Rebase 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
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (omnibox_bounds_ == bounds) 117 if (omnibox_bounds_ == bounds)
118 return; 118 return;
119 119
120 omnibox_bounds_ = bounds; 120 omnibox_bounds_ = bounds;
121 if (instant_tab_) 121 if (instant_tab_)
122 instant_tab_->sender()->SetOmniboxBounds(omnibox_bounds_); 122 instant_tab_->sender()->SetOmniboxBounds(omnibox_bounds_);
123 } 123 }
124 124
125 void InstantController::SetSuggestionToPrefetch( 125 void InstantController::SetSuggestionToPrefetch(
126 const InstantSuggestion& suggestion) { 126 const InstantSuggestion& suggestion) {
127 if (instant_tab_ && search_mode_.is_search()) 127 if (instant_tab_ && search_mode_.is_search()) {
128 instant_tab_->sender()->SetSuggestionToPrefetch(suggestion); 128 SearchTabHelper::FromWebContents(instant_tab_->contents())->
129 SetSuggestionToPrefetch(suggestion);
130 }
129 } 131 }
130 132
131 void InstantController::ToggleVoiceSearch() { 133 void InstantController::ToggleVoiceSearch() {
132 if (instant_tab_) 134 if (instant_tab_)
133 instant_tab_->sender()->ToggleVoiceSearch(); 135 instant_tab_->sender()->ToggleVoiceSearch();
134 } 136 }
135 137
136 void InstantController::InstantPageLoadFailed(content::WebContents* contents) { 138 void InstantController::InstantPageLoadFailed(content::WebContents* contents) {
137 if (!chrome::ShouldPreferRemoteNTPOnStartup()) { 139 if (!chrome::ShouldPreferRemoteNTPOnStartup()) {
138 // We only need to fall back on errors if we're showing the online page 140 // 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
394 content::PAGE_TRANSITION_SERVER_REDIRECT, 396 content::PAGE_TRANSITION_SERVER_REDIRECT,
395 std::string()); // No extra headers. 397 std::string()); // No extra headers.
396 // TODO(dcblack): Remove extraneous history entry caused by 404s. 398 // TODO(dcblack): Remove extraneous history entry caused by 404s.
397 // Note that the base case of a 204 being returned doesn't push a history 399 // Note that the base case of a 204 being returned doesn't push a history
398 // entry. 400 // entry.
399 } 401 }
400 402
401 InstantService* InstantController::GetInstantService() const { 403 InstantService* InstantController::GetInstantService() const {
402 return InstantServiceFactory::GetForProfile(profile()); 404 return InstantServiceFactory::GetForProfile(profile());
403 } 405 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698