Chromium Code Reviews| Index: components/search_engines/desktop_search_utils_win.h |
| diff --git a/components/search_engines/desktop_search_utils_win.h b/components/search_engines/desktop_search_utils_win.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7f250dcc194eb7c9527e6590d9d4b5564175e761 |
| --- /dev/null |
| +++ b/components/search_engines/desktop_search_utils_win.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_WIN_H_ |
| +#define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_UTILS_WIN_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 Windows desktop search |
| +// redirection infobar has already been shown. |
| +extern const char kWindowsDesktopSearchRedirectionInfobarShownPref[]; |
| +} // namespace prefs |
| + |
| +// 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); |
| + |
| +// Replaces |url| by a default search engine URL if it is a desktop search URL |
| +// and these conditions are met: |
| +// - The Windows desktop search redirection feature is enabled. |
| +// - The default search engine is not Bing. |
| +// |should_show_infobar| is set to true if an infobar should be shown to tell |
| +// the user that a redirection occurred. |
| +void ReplaceWindowsDesktopSearchURLWithDefaultSearchURLIfNeeded( |
| + const PrefService* pref_service, |
| + TemplateURLService* template_url_service, |
| + GURL* url, |
| + bool* should_show_infobar); |
|
Peter Kasting
2016/01/20 03:03:02
Why doesn't this return a bool instead of taking i
fdoray
2016/01/21 21:02:34
Done.
|
| + |
| +#endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_UTILS_WIN_H_ |