| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "chrome/browser/search_engines/search_engine_type.h" | 14 #include "chrome/browser/search_engines/search_engine_type.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 class PrefService; | 17 class PrefService; |
| 18 class Profile; | 18 class Profile; |
| 19 class TemplateURL; | 19 class TemplateURL; |
| 20 | 20 |
| 21 namespace TemplateURLPrepopulateData { | 21 namespace TemplateURLPrepopulateData { |
| 22 | 22 |
| 23 extern const int kMaxPrepopulatedEngineID; | 23 extern const int kMaxPrepopulatedEngineID; |
| 24 | 24 |
| 25 #if defined(OS_ANDROID) | 25 #if defined(OS_ANDROID) |
| 26 // Returns the default country code at the time of install from Android. | 26 |
| 27 // This could either be the command line value that has been set or the | 27 // This must be called early only once. |country_code| is the country code at |
| 28 // current location code during install. | 28 // install following the ISO-3166 specification. |
| 29 extern const std::string GetCountryCodeAtInstall(); | 29 void InitCountryCode(const std::string& country_code); |
| 30 |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 void RegisterUserPrefs(PrefService* prefs); | 33 void RegisterUserPrefs(PrefService* prefs); |
| 33 | 34 |
| 34 // Returns the current version of the prepopulate data, so callers can know when | 35 // Returns the current version of the prepopulate data, so callers can know when |
| 35 // they need to re-merge. If the prepopulate data comes from the preferences | 36 // they need to re-merge. If the prepopulate data comes from the preferences |
| 36 // file then it returns the version specified there. | 37 // file then it returns the version specified there. |
| 37 int GetDataVersion(PrefService* prefs); | 38 int GetDataVersion(PrefService* prefs); |
| 38 | 39 |
| 39 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the | 40 // Loads the set of TemplateURLs from the prepopulate data. Ownership of the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 53 // Returns the type of the matching engine, or SEARCH_ENGINE_OTHER if no engines | 54 // Returns the type of the matching engine, or SEARCH_ENGINE_OTHER if no engines |
| 54 // match. This uses same-origin checks unless the |url| is a Google seach URL, | 55 // match. This uses same-origin checks unless the |url| is a Google seach URL, |
| 55 // in which case we'll identify any valid Google hostname as "Google". | 56 // in which case we'll identify any valid Google hostname as "Google". |
| 56 // | 57 // |
| 57 // NOTE: Must be called on the UI thread. | 58 // NOTE: Must be called on the UI thread. |
| 58 SearchEngineType GetEngineType(const std::string& url); | 59 SearchEngineType GetEngineType(const std::string& url); |
| 59 | 60 |
| 60 } // namespace TemplateURLPrepopulateData | 61 } // namespace TemplateURLPrepopulateData |
| 61 | 62 |
| 62 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 63 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| OLD | NEW |