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

Side by Side Diff: chrome/browser/search_engines/search_terms_data.cc

Issue 106103006: Added android Template URL support for voice search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed IsVoiceSearchURL Created 7 years 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/search_engines/search_terms_data.h" 5 #include "chrome/browser/search_engines/search_terms_data.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 std::string SearchTermsData::GetSuggestClient() const { 72 std::string SearchTermsData::GetSuggestClient() const {
73 return std::string(); 73 return std::string();
74 } 74 }
75 75
76 std::string SearchTermsData::ForceInstantResultsParam( 76 std::string SearchTermsData::ForceInstantResultsParam(
77 bool for_prerender) const { 77 bool for_prerender) const {
78 return std::string(); 78 return std::string();
79 } 79 }
80 80
81 std::string SearchTermsData::VoiceInputSourceParam(
82 bool is_voice_input_source) const {
83 return std::string();
84 }
85
81 std::string SearchTermsData::InstantExtendedEnabledParam() const { 86 std::string SearchTermsData::InstantExtendedEnabledParam() const {
82 return std::string(); 87 return std::string();
83 } 88 }
84 89
85 std::string SearchTermsData::NTPIsThemedParam() const { 90 std::string SearchTermsData::NTPIsThemedParam() const {
86 return std::string(); 91 return std::string();
87 } 92 }
88 93
89 // static 94 // static
90 std::string* UIThreadSearchTermsData::google_base_url_ = NULL; 95 std::string* UIThreadSearchTermsData::google_base_url_ = NULL;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 157 }
153 158
154 std::string UIThreadSearchTermsData::ForceInstantResultsParam( 159 std::string UIThreadSearchTermsData::ForceInstantResultsParam(
155 bool for_prerender) const { 160 bool for_prerender) const {
156 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || 161 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) ||
157 BrowserThread::CurrentlyOn(BrowserThread::UI)); 162 BrowserThread::CurrentlyOn(BrowserThread::UI));
158 return (for_prerender || !chrome::IsInstantExtendedAPIEnabled()) ? "ion=1&" : 163 return (for_prerender || !chrome::IsInstantExtendedAPIEnabled()) ? "ion=1&" :
159 std::string(); 164 std::string();
160 } 165 }
161 166
167 std::string UIThreadSearchTermsData::VoiceInputSourceParam(
168 bool is_voice_input_source) const {
169 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) ||
170 BrowserThread::CurrentlyOn(BrowserThread::UI));
171 return (is_voice_input_source) ? "inm=vs&" : std::string();
172 }
173
162 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam() const { 174 std::string UIThreadSearchTermsData::InstantExtendedEnabledParam() const {
163 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || 175 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) ||
164 BrowserThread::CurrentlyOn(BrowserThread::UI)); 176 BrowserThread::CurrentlyOn(BrowserThread::UI));
165 uint64 instant_extended_api_version = chrome::EmbeddedSearchPageVersion(); 177 uint64 instant_extended_api_version = chrome::EmbeddedSearchPageVersion();
166 if (instant_extended_api_version) { 178 if (instant_extended_api_version) {
167 return std::string(google_util::kInstantExtendedAPIParam) + "=" + 179 return std::string(google_util::kInstantExtendedAPIParam) + "=" +
168 base::Uint64ToString(instant_extended_api_version) + "&"; 180 base::Uint64ToString(instant_extended_api_version) + "&";
169 } 181 }
170 return std::string(); 182 return std::string();
171 } 183 }
(...skipping 15 matching lines...) Expand all
187 #endif // defined(ENABLE_THEMES) 199 #endif // defined(ENABLE_THEMES)
188 200
189 return std::string(); 201 return std::string();
190 } 202 }
191 203
192 // static 204 // static
193 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { 205 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) {
194 delete google_base_url_; 206 delete google_base_url_;
195 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); 207 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url);
196 } 208 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698