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

Side by Side Diff: chrome/browser/search_engines/default_search_manager.h

Issue 229763005: Store default search provider data in dictionary pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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 CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_
7
8 #include "base/macros.h"
9
10 namespace user_prefs {
11 class PrefRegistrySyncable;
12 }
13
14 class PrefService;
15 struct TemplateURLData;
16
17 // DefaultSearchManager handles the loading and writing of the user's default
18 // search engine selection to and from prefs.
19
20 class DefaultSearchManager {
21 public:
22 static const char kID[];
23 static const char kShortName[];
24 static const char kKeyword[];
25 static const char kPrepopulateID[];
26 static const char kSyncGUID[];
27
28 static const char kURL[];
29 static const char kSuggestionsURL[];
30 static const char kInstantURL[];
31 static const char kImageURL[];
32 static const char kNewTabURL[];
33 static const char kFaviconURL[];
34 static const char kOriginatingURL[];
35
36 static const char kSearchURLPostParams[];
37 static const char kSuggestionsURLPostParams[];
38 static const char kInstantURLPostParams[];
39 static const char kImageURLPostParams[];
40
41 static const char kSafeForAutoReplace[];
42 static const char kInputEncodings[];
43
44 static const char kDateCreated[];
45 static const char kLastModified[];
46
47 static const char kUsageCount[];
48 static const char kAlternateURLs[];
49 static const char kSearchTermsReplacementKey[];
50 static const char kCreatedByPolicy[];
51
52 explicit DefaultSearchManager(PrefService* pref_service);
53 ~DefaultSearchManager();
54
55 // Register prefs needed for tracking the default search provider.
56 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
57
58 // Read default search provider data from |pref_service_|.
59 bool GetDefaultSearchEngine(TemplateURLData* url);
60
61 // Write default search provider data to |pref_service_|.
62 void SetUserSelectedDefaultSearchEngine(const TemplateURLData& data);
63
64 private:
65 PrefService* pref_service_;
66
67 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager);
68 };
69
70 #endif // CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698