| 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 Profile; | 17 class Profile; |
| 18 class TemplateURL; | 18 class TemplateURL; |
| 19 | 19 |
| 20 namespace TemplateURLPrepopulateData { | 20 namespace TemplateURLPrepopulateData { |
| 21 | 21 |
| 22 extern const int kMaxPrepopulatedEngineID; | 22 extern const int kMaxPrepopulatedEngineID; |
| 23 | 23 |
| 24 // Sizes at which search provider logos are available. |
| 25 enum LogoSize { |
| 26 LOGO_100_PERCENT, |
| 27 LOGO_200_PERCENT, |
| 28 }; |
| 29 |
| 24 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
| 25 | 31 |
| 26 // This must be called early only once. |country_code| is the country code at | 32 // This must be called early only once. |country_code| is the country code at |
| 27 // install following the ISO-3166 specification. | 33 // install following the ISO-3166 specification. |
| 28 void InitCountryCode(const std::string& country_code); | 34 void InitCountryCode(const std::string& country_code); |
| 29 | 35 |
| 30 #endif | 36 #endif |
| 31 | 37 |
| 32 void RegisterUserPrefs(PrefService* prefs); | 38 void RegisterUserPrefs(PrefService* prefs); |
| 33 | 39 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 50 // not used. | 56 // not used. |
| 51 TemplateURL* GetPrepopulatedDefaultSearch(Profile* profile); | 57 TemplateURL* GetPrepopulatedDefaultSearch(Profile* profile); |
| 52 | 58 |
| 53 // Returns the type of the matching engine, or SEARCH_ENGINE_OTHER if no engines | 59 // 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, | 60 // 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". | 61 // in which case we'll identify any valid Google hostname as "Google". |
| 56 // | 62 // |
| 57 // NOTE: Must be called on the UI thread. | 63 // NOTE: Must be called on the UI thread. |
| 58 SearchEngineType GetEngineType(const std::string& url); | 64 SearchEngineType GetEngineType(const std::string& url); |
| 59 | 65 |
| 66 // Returns the logo at the specified |size| for |template_url|. If no logo is |
| 67 // known, this will return an empty GURL. |
| 68 // |
| 69 // NOTE: Must be called on the UI thread. |
| 70 GURL GetLogoURL(const TemplateURL& template_url, LogoSize size); |
| 71 |
| 60 } // namespace TemplateURLPrepopulateData | 72 } // namespace TemplateURLPrepopulateData |
| 61 | 73 |
| 62 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ | 74 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_ |
| OLD | NEW |