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

Unified Diff: components/search_engines/template_url.cc

Issue 1141743003: [Mobile] Upstream fix for yandex search engine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address pkasting comments Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/search_engines/prepopulated_engines.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index fc2c6f187fa4e0e25bf300cfc1132d9f2cb9c2fc..2be58e310d36148310103622b6cc0c50fc750de3 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -28,6 +28,7 @@
#include "net/base/escape.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
+#include "ui/base/device_form_factor.h"
#include "url/gurl.h"
namespace {
@@ -686,6 +687,15 @@ bool TemplateURLRef::ParseParameter(size_t start,
replacements->push_back(Replacement(GOOGLE_SUGGEST_REQUEST_ID, start));
} else if (parameter == kGoogleUnescapedSearchTermsParameter) {
replacements->push_back(Replacement(GOOGLE_UNESCAPED_SEARCH_TERMS, start));
+ } else if (parameter == "yandex:searchPath") {
+#if defined(OS_ANDROID) || defined(OS_IOS)
Peter Kasting 2015/05/18 18:25:58 Maybe instead of the #ifs here we should be using
sdefresne 2015/05/19 09:09:20 Done.
+ if (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET)
+ url->insert(start, "padsearch");
+ else
+ url->insert(start, "touchsearch");
+#else
+ url->insert(start, "yandsearch");
+#endif
} else if (parameter == kInputEncodingParameter) {
replacements->push_back(Replacement(ENCODING, start));
} else if (parameter == kLanguageParameter) {
« no previous file with comments | « components/search_engines/prepopulated_engines.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698