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

Unified Diff: components/search_engines/detect_desktop_search_win.cc

Issue 1477783004: Add a preference to control Windows desktop search redirection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/search_engines/detect_desktop_search_win.cc
diff --git a/components/search_engines/detect_desktop_search_win.cc b/components/search_engines/detect_desktop_search_win.cc
deleted file mode 100644
index 563e80de7f16d668065bbfb24ea25e68aef1cadf..0000000000000000000000000000000000000000
--- a/components/search_engines/detect_desktop_search_win.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/search_engines/detect_desktop_search_win.h"
-
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/string_util.h"
-#include "components/search_engines/prepopulated_engines.h"
-#include "components/search_engines/template_url.h"
-#include "components/search_engines/template_url_prepopulate_data.h"
-#include "net/base/url_util.h"
-
-bool DetectWindowsDesktopSearch(const GURL& url,
- const SearchTermsData& search_terms_data,
- base::string16* search_terms) {
- DCHECK(search_terms);
-
- scoped_ptr<TemplateURLData> template_url_data =
- TemplateURLPrepopulateData::MakeTemplateURLDataFromPrepopulatedEngine(
- TemplateURLPrepopulateData::bing);
- TemplateURL template_url(*template_url_data);
-
- if (!template_url.ExtractSearchTermsFromURL(url, search_terms_data,
- search_terms))
- return false;
-
- // Query parameter that tells the source of a Bing search URL, and values
- // associated with Windows desktop search.
- const char kBingSourceQueryKey[] = "form";
- const char kBingSourceDesktopText[] = "WNSGPH";
- const char kBingSourceDesktopVoice[] = "WNSBOX";
-
- for (net::QueryIterator it(url); !it.IsAtEnd(); it.Advance()) {
- // Use a case-insensitive comparison because the key is sometimes in capital
- // letters.
- if (base::EqualsCaseInsensitiveASCII(it.GetKey(), kBingSourceQueryKey)) {
- std::string source = it.GetValue();
- if (source == kBingSourceDesktopText || source == kBingSourceDesktopVoice)
- return true;
- }
- }
-
- search_terms->clear();
- return false;
-}
« no previous file with comments | « components/search_engines/detect_desktop_search_win.h ('k') | components/search_engines/search_engines_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698