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

Unified Diff: components/search_engines/desktop_search_win.h

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
« no previous file with comments | « components/search_engines/BUILD.gn ('k') | components/search_engines/desktop_search_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/desktop_search_win.h
diff --git a/components/search_engines/desktop_search_win.h b/components/search_engines/desktop_search_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..162e95f286c72c81721c7ef2b4b95813cc2eeb3a
--- /dev/null
+++ b/components/search_engines/desktop_search_win.h
@@ -0,0 +1,44 @@
+// 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.
+
+#ifndef COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_WIN_H_
+#define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_WIN_H_
+
+#include "base/feature_list.h"
+#include "base/strings/string16.h"
+
+class GURL;
+class PrefService;
+class SearchTermsData;
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+namespace prefs {
+// Name of the Windows desktop search redirection preference.
+extern const char kWindowsDesktopSearchRedirectionPref[];
+}
+
+// Windows desktop search redirection feature. This is exposed in the header
+// file so that it can be referenced from about_flags.cc.
+extern const base::Feature kWindowsDesktopSearchRedirectionFeature;
+
+// Registers the Windows desktop search redirection preference into |registry|.
+void RegisterWindowsDesktopSearchRedirectionPref(
+ user_prefs::PrefRegistrySyncable* registry);
+
+// Indicates whether Windows desktop searches should be redirected to the
+// default search engine. This is only true when both the preference and the
+// feature are enabled. The preference value is read from |pref_service|.
+bool ShouldRedirectWindowsDesktopSearchToDefaultSearchEngine(
+ PrefService* pref_service);
+
+// Detects whether a URL comes from a Windows Desktop search. If so, puts the
+// search terms in |search_terms| and returns true.
+bool DetectWindowsDesktopSearch(const GURL& url,
+ const SearchTermsData& search_terms_data,
+ base::string16* search_terms);
+
+#endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_WIN_H_
« no previous file with comments | « components/search_engines/BUILD.gn ('k') | components/search_engines/desktop_search_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698