OLD | NEW |
(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 // Clear the user's default search provider choice from |pref_service_|. |
| 65 void ClearUserSelectedDefaultSearchEngine(); |
| 66 |
| 67 private: |
| 68 PrefService* pref_service_; |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(DefaultSearchManager); |
| 71 }; |
| 72 |
| 73 #endif // CHROME_BROWSER_SEARCH_ENGINES_DEFAULT_SEARCH_MANAGER_H_ |
OLD | NEW |