OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_UTILS_H_ | |
6 #define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_UTILS_H_ | |
7 | |
8 #include "base/feature_list.h" | |
9 #include "base/strings/string16.h" | |
10 #include "url/gurl.h" | |
11 | |
12 class PrefService; | |
13 class TemplateURLService; | |
14 | |
15 namespace user_prefs { | |
16 class PrefRegistrySyncable; | |
17 } | |
18 | |
19 namespace prefs { | |
20 // Name of the preference keeping track of whether the desktop search | |
21 // redirection infobar has been shown. | |
22 extern const char kDesktopSearchRedirectionInfobarShownPref[]; | |
23 } // namespace prefs | |
Peter Kasting
2016/01/22 00:38:57
Nit: I wouldn't bother with this comment
fdoray
2016/02/01 15:15:54
Done.
| |
24 | |
25 // Desktop search redirection feature. This is exposed in the header file so | |
26 // that it can be referenced from about_flags.cc. | |
27 extern const base::Feature kDesktopSearchRedirectionFeature; | |
28 | |
29 // Registers the preference keeping track of whether the desktop search | |
30 // redirection infobar has been shown in |registry|. | |
Peter Kasting
2016/01/22 00:38:57
Nit: I'd remove "in |registry|" since that's impli
fdoray
2016/02/01 15:15:54
Done.
| |
31 void RegisterDesktopSearchRedirectionPref( | |
32 user_prefs::PrefRegistrySyncable* registry); | |
33 | |
34 // Replaces |url| by a default search engine URL and returns true if: | |
Peter Kasting
2016/01/22 00:38:57
Nit: Remove "and returns true"
fdoray
2016/02/01 15:15:54
Done.
| |
35 // - |url| is a desktop search URL. | |
36 // - The desktop search redirection feature is enabled. | |
37 // - The default search engine is not Bing. | |
38 // Returns true if an infobar should be shown to tell the user about the | |
39 // redirection. | |
40 bool ReplaceDesktopSearchURLWithDefaultSearchURLIfNeeded( | |
41 const PrefService* pref_service, | |
42 TemplateURLService* template_url_service, | |
43 GURL* url); | |
44 | |
45 #endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_UTILS_H_ | |
OLD | NEW |