| 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 PrefServiceSyncable; |
| 17 class Profile; | 18 class Profile; |
| 18 class TemplateURL; | 19 class TemplateURL; |
| 19 | 20 |
| 20 namespace TemplateURLPrepopulateData { | 21 namespace TemplateURLPrepopulateData { |
| 21 | 22 |
| 22 extern const int kMaxPrepopulatedEngineID; | 23 extern const int kMaxPrepopulatedEngineID; |
| 23 | 24 |
| 24 // Sizes at which search provider logos are available. | 25 // Sizes at which search provider logos are available. |
| 25 enum LogoSize { | 26 enum LogoSize { |
| 26 LOGO_100_PERCENT, | 27 LOGO_100_PERCENT, |
| 27 LOGO_200_PERCENT, | 28 LOGO_200_PERCENT, |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
| 31 | 32 |
| 32 // This must be called early only once. |country_code| is the country code at | 33 // This must be called early only once. |country_code| is the country code at |
| 33 // install following the ISO-3166 specification. | 34 // install following the ISO-3166 specification. |
| 34 void InitCountryCode(const std::string& country_code); | 35 void InitCountryCode(const std::string& country_code); |
| 35 | 36 |
| 36 #endif | 37 #endif |
| 37 | 38 |
| 38 void RegisterUserPrefs(PrefService* prefs); | 39 void RegisterUserPrefs(PrefServiceSyncable* prefs); |
| 39 | 40 |
| 40 // Returns the current version of the prepopulate data, so callers can know when | 41 // Returns the current version of the prepopulate data, so callers can know when |
| 41 // they need to re-merge. If the prepopulate data comes from the preferences | 42 // they need to re-merge. If the prepopulate data comes from the preferences |
| 42 // file then it returns the version specified there. | 43 // file then it returns the version specified there. |
| 43 int GetDataVersion(PrefService* prefs); | 44 int GetDataVersion(PrefService* prefs); |
| 44 | 45 |
| 45 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the | 46 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the |
| 46 // TemplateURLs is passed to the caller. On return, | 47 // TemplateURLs is passed to the caller. On return, |
| 47 // |default_search_provider_index| is set to the index of the default search | 48 // |default_search_provider_index| is set to the index of the default search |
| 48 // provider. | 49 // provider. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 65 | 66 |
| 66 // Returns the logo at the specified |size| for |template_url|. If no logo is | 67 // Returns the logo at the specified |size| for |template_url|. If no logo is |
| 67 // known, this will return an empty GURL. | 68 // known, this will return an empty GURL. |
| 68 // | 69 // |
| 69 // NOTE: Must be called on the UI thread. | 70 // NOTE: Must be called on the UI thread. |
| 70 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); | 71 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); |
| 71 | 72 |
| 72 } // namespace TemplateURLPrepopulateData | 73 } // namespace TemplateURLPrepopulateData |
| 73 | 74 |
| 74 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 75 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| OLD | NEW |