| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/browser/search_engines/search_engine_type.h" | 13 #include "chrome/browser/search_engines/search_engine_type.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 class PrefService; | 16 class PrefService; |
| 17 class PrefRegistrySyncable; | |
| 18 class Profile; | 17 class Profile; |
| 19 class TemplateURL; | 18 class TemplateURL; |
| 20 | 19 |
| 20 namespace user_prefs { |
| 21 class PrefRegistrySyncable; |
| 22 } |
| 23 |
| 21 namespace TemplateURLPrepopulateData { | 24 namespace TemplateURLPrepopulateData { |
| 22 | 25 |
| 23 extern const int kMaxPrepopulatedEngineID; | 26 extern const int kMaxPrepopulatedEngineID; |
| 24 | 27 |
| 25 // Sizes at which search provider logos are available. | 28 // Sizes at which search provider logos are available. |
| 26 enum LogoSize { | 29 enum LogoSize { |
| 27 LOGO_100_PERCENT, | 30 LOGO_100_PERCENT, |
| 28 LOGO_200_PERCENT, | 31 LOGO_200_PERCENT, |
| 29 }; | 32 }; |
| 30 | 33 |
| 31 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
| 32 | 35 |
| 33 // This must be called early only once. |country_code| is the country code at | 36 // This must be called early only once. |country_code| is the country code at |
| 34 // install following the ISO-3166 specification. | 37 // install following the ISO-3166 specification. |
| 35 void InitCountryCode(const std::string& country_code); | 38 void InitCountryCode(const std::string& country_code); |
| 36 | 39 |
| 37 #endif | 40 #endif |
| 38 | 41 |
| 39 void RegisterUserPrefs(PrefRegistrySyncable* registry); | 42 void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 40 | 43 |
| 41 // Returns the current version of the prepopulate data, so callers can know when | 44 // Returns the current version of the prepopulate data, so callers can know when |
| 42 // they need to re-merge. If the prepopulate data comes from the preferences | 45 // they need to re-merge. If the prepopulate data comes from the preferences |
| 43 // file then it returns the version specified there. | 46 // file then it returns the version specified there. |
| 44 int GetDataVersion(PrefService* prefs); | 47 int GetDataVersion(PrefService* prefs); |
| 45 | 48 |
| 46 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the | 49 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the |
| 47 // TemplateURLs is passed to the caller. On return, | 50 // TemplateURLs is passed to the caller. On return, |
| 48 // |default_search_provider_index| is set to the index of the default search | 51 // |default_search_provider_index| is set to the index of the default search |
| 49 // provider. | 52 // provider. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 66 | 69 |
| 67 // Returns the logo at the specified |size| for |template_url|. If no logo is | 70 // Returns the logo at the specified |size| for |template_url|. If no logo is |
| 68 // known, this will return an empty GURL. | 71 // known, this will return an empty GURL. |
| 69 // | 72 // |
| 70 // NOTE: Must be called on the UI thread. | 73 // NOTE: Must be called on the UI thread. |
| 71 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); | 74 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); |
| 72 | 75 |
| 73 } // namespace TemplateURLPrepopulateData | 76 } // namespace TemplateURLPrepopulateData |
| 74 | 77 |
| 75 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 78 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| OLD | NEW |