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

Unified Diff: components/search_engines/desktop_search_utils.h

Issue 1598553003: Implement the Windows desktop search redirection feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build errors due to prefs being moved in components Created 4 years, 11 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
Index: components/search_engines/desktop_search_utils.h
diff --git a/components/search_engines/desktop_search_utils.h b/components/search_engines/desktop_search_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..773ff7f56b865eff6f901923959964113794e7f3
--- /dev/null
+++ b/components/search_engines/desktop_search_utils.h
@@ -0,0 +1,45 @@
+// Copyright 2016 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_UTILS_H_
+#define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_UTILS_H_
+
+#include "base/feature_list.h"
+#include "base/strings/string16.h"
+#include "url/gurl.h"
+
+class PrefService;
+class TemplateURLService;
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+namespace prefs {
+// Name of the preference keeping track of whether the desktop search
+// redirection infobar has been shown.
+extern const char kDesktopSearchRedirectionInfobarShownPref[];
+}
+
+// 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 kDesktopSearchRedirectionFeature;
+
+// Registers the preference keeping track of whether the desktop search
+// redirection infobar has been shown.
+void RegisterDesktopSearchRedirectionPref(
+ user_prefs::PrefRegistrySyncable* registry);
+
+// Replaces |url| by a default search engine URL if:
+// - |url| is a desktop search URL.
+// - The desktop search redirection feature is enabled.
+// - The default search engine is not Bing.
+// Returns true if an infobar should be shown to tell the user about the
+// redirection.
+bool ReplaceDesktopSearchURLWithDefaultSearchURLIfNeeded(
+ const PrefService* pref_service,
+ TemplateURLService* template_url_service,
+ GURL* url);
+
+#endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698