Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: chrome/browser/search_engines/template_url.h

Issue 3040022: Add new search engine logos to template url data.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
11 11
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
14 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
15 16
16 class TemplateURL; 17 class TemplateURL;
17 18
18 // TemplateURL represents the relevant portions of the Open Search Description 19 // TemplateURL represents the relevant portions of the Open Search Description
19 // Document (http://www.opensearch.org/Specifications/OpenSearch). 20 // Document (http://www.opensearch.org/Specifications/OpenSearch).
20 // The main use case for TemplateURL is to use the TemplateURLRef returned by 21 // The main use case for TemplateURL is to use the TemplateURLRef returned by
21 // suggestions_url or url for keyword/suggestion expansion: 22 // suggestions_url or url for keyword/suggestion expansion:
22 // . suggestions_url describes a URL that is ideal for as you type suggestions. 23 // . suggestions_url describes a URL that is ideal for as you type suggestions.
23 // The returned results are in the mime type application/x-suggestions+json. 24 // The returned results are in the mime type application/x-suggestions+json.
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 static bool SupportsReplacement(const TemplateURL* turl); 268 static bool SupportsReplacement(const TemplateURL* turl);
268 269
269 TemplateURL() 270 TemplateURL()
270 : autogenerate_keyword_(false), 271 : autogenerate_keyword_(false),
271 keyword_generated_(false), 272 keyword_generated_(false),
272 show_in_default_list_(false), 273 show_in_default_list_(false),
273 safe_for_autoreplace_(false), 274 safe_for_autoreplace_(false),
274 id_(0), 275 id_(0),
275 date_created_(base::Time::Now()), 276 date_created_(base::Time::Now()),
276 usage_count_(0), 277 usage_count_(0),
278 search_engine_type_(TemplateURLPrepopulateData::SEARCH_ENGINE_OTHER),
279 logo_id_(0),
277 prepopulate_id_(0) {} 280 prepopulate_id_(0) {}
278 ~TemplateURL() {} 281 ~TemplateURL() {}
279 282
280 // A short description of the template. This is the name we show to the user 283 // A short description of the template. This is the name we show to the user
281 // in various places that use keywords. For example, the location bar shows 284 // in various places that use keywords. For example, the location bar shows
282 // this when the user selects the keyword. 285 // this when the user selects the keyword.
283 void set_short_name(const std::wstring& short_name) { 286 void set_short_name(const std::wstring& short_name) {
284 short_name_ = short_name; 287 short_name_ = short_name;
285 } 288 }
286 const std::wstring& short_name() const { return short_name_; } 289 const std::wstring& short_name() const { return short_name_; }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 void set_input_encodings(const std::vector<std::string>& encodings) { 410 void set_input_encodings(const std::vector<std::string>& encodings) {
408 input_encodings_ = encodings; 411 input_encodings_ = encodings;
409 } 412 }
410 void add_input_encoding(const std::string& encoding) { 413 void add_input_encoding(const std::string& encoding) {
411 input_encodings_.push_back(encoding); 414 input_encodings_.push_back(encoding);
412 } 415 }
413 const std::vector<std::string>& input_encodings() const { 416 const std::vector<std::string>& input_encodings() const {
414 return input_encodings_; 417 return input_encodings_;
415 } 418 }
416 419
420 void set_search_engine_type(TemplateURLPrepopulateData::SearchEngineType
421 search_engine_type) {
422 search_engine_type_ = search_engine_type;
423 }
424 TemplateURLPrepopulateData::SearchEngineType search_engine_type() const {
425 return search_engine_type_;
426 }
427
428 void set_logo_id(int logo_id) { logo_id_ = logo_id; }
429 int logo_id() const { return logo_id_; }
430
417 // Returns the unique identifier of this TemplateURL. The unique ID is set 431 // Returns the unique identifier of this TemplateURL. The unique ID is set
418 // by the TemplateURLModel when the TemplateURL is added to it. 432 // by the TemplateURLModel when the TemplateURL is added to it.
419 IDType id() const { return id_; } 433 IDType id() const { return id_; }
420 434
421 // If this TemplateURL comes from prepopulated data the prepopulate_id is > 0. 435 // If this TemplateURL comes from prepopulated data the prepopulate_id is > 0.
422 void set_prepopulate_id(int id) { prepopulate_id_ = id; } 436 void set_prepopulate_id(int id) { prepopulate_id_ = id; }
423 int prepopulate_id() const { return prepopulate_id_; } 437 int prepopulate_id() const { return prepopulate_id_; }
424 438
425 std::string GetExtensionId() const; 439 std::string GetExtensionId() const;
426 bool IsExtensionKeyword() const; 440 bool IsExtensionKeyword() const;
(...skipping 22 matching lines...) Expand all
449 // generating a keyword failed. 463 // generating a keyword failed.
450 bool show_in_default_list_; 464 bool show_in_default_list_;
451 bool safe_for_autoreplace_; 465 bool safe_for_autoreplace_;
452 std::vector<ImageRef> image_refs_; 466 std::vector<ImageRef> image_refs_;
453 std::vector<std::wstring> languages_; 467 std::vector<std::wstring> languages_;
454 // List of supported input encodings. 468 // List of supported input encodings.
455 std::vector<std::string> input_encodings_; 469 std::vector<std::string> input_encodings_;
456 IDType id_; 470 IDType id_;
457 base::Time date_created_; 471 base::Time date_created_;
458 int usage_count_; 472 int usage_count_;
473 TemplateURLPrepopulateData::SearchEngineType search_engine_type_;
474 int logo_id_;
459 int prepopulate_id_; 475 int prepopulate_id_;
460 476
461 // TODO(sky): Add date last parsed OSD file. 477 // TODO(sky): Add date last parsed OSD file.
462 }; 478 };
463 479
464 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ 480 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_
OLDNEW
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/search_engines/template_url_prepopulate_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698