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

Side by Side 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: Declare feature in header file. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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_WIN_H_
6 #define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_WIN_H_
7
8 #include "base/feature_list.h"
9 #include "base/strings/string16.h"
10
11 class GURL;
12 class PrefService;
13 class SearchTermsData;
14
15 namespace user_prefs {
16 class PrefRegistrySyncable;
17 }
18
19 // Values for the Windows desktop search redirection preference. ENABLED means
20 // that the user has explicitly chosen to redirect desktop searches to the
21 // default search engine. DISABLED means that the user has chosen not to use the
22 // default search engine for desktop searches. UNSET means that no value has
23 // been explicitly set for the preference, i.e. the browser should prompt the
24 // user before redirecting a desktop search to the default search engine.
25 enum class WindowsDesktopSearchRedirectionPref {
26 ENABLED,
27 DISABLED,
28 UNSET,
29 };
30
31 // Windows desktop search redirection feature.
32 extern const base::Feature kWindowsDesktopSearchRedirectionFeature;
Peter Kasting 2015/12/01 02:23:05 There's no need to declare this in the header as o
fdoray 2015/12/02 17:28:27 It's required if I want the feature to be controll
33
34 // Registers the Windows desktop search redirection preference into |registry|.
35 void RegisterWindowsDesktopSearchRedirectionPref(
36 user_prefs::PrefRegistrySyncable* registry);
37
38 // Reads the value of the Windows desktop search redirection preference from
39 // |pref_service|.
40 WindowsDesktopSearchRedirectionPref GetWindowsDesktopSearchRedirectionPref(
41 PrefService* pref_service);
42
43 // Returns true if the Windows desktop search redirection feature is enabled.
44 // When the feature is disabled, Windows desktop searches are never redirected
45 // to the default search engine and the redirection preference doesn't appear
46 // on the settings page.
47 bool WindowsDesktopSearchRedirectionFeatureIsEnabled();
48
49 // Detects whether a URL comes from a Windows Desktop search. If so, puts the
50 // search terms in |search_terms| and returns true.
51 bool DetectWindowsDesktopSearch(const GURL& url,
52 const SearchTermsData& search_terms_data,
53 base::string16* search_terms);
54
55 #endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698