| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 int width; | 270 int width; |
| 271 int height; | 271 int height; |
| 272 | 272 |
| 273 // URL of the image. | 273 // URL of the image. |
| 274 GURL url; | 274 GURL url; |
| 275 }; | 275 }; |
| 276 | 276 |
| 277 // Generates a favicon URL from the specified url. | 277 // Generates a favicon URL from the specified url. |
| 278 static GURL GenerateFaviconURL(const GURL& url); | 278 static GURL GenerateFaviconURL(const GURL& url); |
| 279 | 279 |
| 280 // Returns true if |true| is non-null and has a search URL that supports | 280 // Returns true if |turl| is non-null and has a search URL that supports |
| 281 // replacement. | 281 // replacement. |
| 282 static bool SupportsReplacement(const TemplateURL* turl); | 282 static bool SupportsReplacement(const TemplateURL* turl); |
| 283 | 283 |
| 284 // Like SupportsReplacement but usable on threads other than the UI thread. | 284 // Like SupportsReplacement but usable on threads other than the UI thread. |
| 285 static bool SupportsReplacementUsingTermsData( | 285 static bool SupportsReplacementUsingTermsData( |
| 286 const TemplateURL* turl, | 286 const TemplateURL* turl, |
| 287 const SearchTermsData& search_terms_data); | 287 const SearchTermsData& search_terms_data); |
| 288 | 288 |
| 289 TemplateURL(); | 289 TemplateURL(); |
| 290 ~TemplateURL(); | 290 ~TemplateURL(); |
| 291 | 291 |
| 292 // A short description of the template. This is the name we show to the user | 292 // A short description of the template. This is the name we show to the user |
| 293 // in various places that use keywords. For example, the location bar shows | 293 // in various places that use keywords. For example, the location bar shows |
| 294 // this when the user selects the keyword. | 294 // this when the user selects the keyword. |
| 295 void set_short_name(const std::wstring& short_name) { | 295 void set_short_name(const std::wstring& short_name) { |
| 296 short_name_ = short_name; | 296 short_name_ = short_name; |
| 297 } | 297 } |
| 298 const std::wstring& short_name() const { return short_name_; } | 298 const std::wstring& short_name() const { return short_name_; } |
| 299 | 299 |
| 300 // Returns true if this search engine supports showing instant results. |
| 301 // TODO(sky): make this real. |
| 302 bool supports_instant() const { return false; } |
| 303 |
| 300 // An accessor for the short_name, but adjusted so it can be appropriately | 304 // An accessor for the short_name, but adjusted so it can be appropriately |
| 301 // displayed even if it is LTR and the UI is RTL. | 305 // displayed even if it is LTR and the UI is RTL. |
| 302 std::wstring AdjustedShortNameForLocaleDirection() const; | 306 std::wstring AdjustedShortNameForLocaleDirection() const; |
| 303 | 307 |
| 304 // A description of the template; this may be empty. | 308 // A description of the template; this may be empty. |
| 305 void set_description(const std::wstring& description) { | 309 void set_description(const std::wstring& description) { |
| 306 description_ = description; | 310 description_ = description; |
| 307 } | 311 } |
| 308 const std::wstring& description() const { return description_; } | 312 const std::wstring& description() const { return description_; } |
| 309 | 313 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 bool created_by_policy_; | 503 bool created_by_policy_; |
| 500 int usage_count_; | 504 int usage_count_; |
| 501 TemplateURLPrepopulateData::SearchEngineType search_engine_type_; | 505 TemplateURLPrepopulateData::SearchEngineType search_engine_type_; |
| 502 int logo_id_; | 506 int logo_id_; |
| 503 int prepopulate_id_; | 507 int prepopulate_id_; |
| 504 | 508 |
| 505 // TODO(sky): Add date last parsed OSD file. | 509 // TODO(sky): Add date last parsed OSD file. |
| 506 }; | 510 }; |
| 507 | 511 |
| 508 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 512 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
| OLD | NEW |