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

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

Issue 11552020: Add search_terms_replacement_key field to TemplateURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Answered PK's comments. Created 8 years 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) 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_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 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 int prepopulate_id; 345 int prepopulate_id;
346 346
347 // The primary unique identifier for Sync. This set on all TemplateURLs 347 // The primary unique identifier for Sync. This set on all TemplateURLs
348 // regardless of whether they have been associated with Sync. 348 // regardless of whether they have been associated with Sync.
349 std::string sync_guid; 349 std::string sync_guid;
350 350
351 // A list of URL patterns that can be used, in addition to |url_|, to extract 351 // A list of URL patterns that can be used, in addition to |url_|, to extract
352 // search terms from a URL. 352 // search terms from a URL.
353 std::vector<std::string> alternate_urls; 353 std::vector<std::string> alternate_urls;
354 354
355 // A parameter that, if present and non-zero in a search_url or instant_url,
akalin 2012/12/20 17:13:59 what exactly does 'non-zero' mean? Do you mean 'n
Peter Kasting 2012/12/20 19:09:29 This was my same question. See the earlier exchan
akalin 2012/12/20 19:41:26 I see. I still think it should be clarified. So
Peter Kasting 2012/12/20 19:43:17 It's sounding from David's answer like we can scra
beaudoin 2013/01/03 18:49:40 Changed to "present in the query or ref". Done.
356 // causes Chrome to replace the URL with the search term.
357 // The parameter must be in the query if the search terms are in the query,
358 // and in the ref if the search terms are in the ref.
359 std::string search_terms_replacement_key;
360
355 private: 361 private:
356 // Private so we can enforce using the setters and thus enforce that these 362 // Private so we can enforce using the setters and thus enforce that these
357 // fields are never empty. 363 // fields are never empty.
358 string16 keyword_; 364 string16 keyword_;
359 std::string url_; 365 std::string url_;
360 }; 366 };
361 367
362 368
363 // TemplateURL ---------------------------------------------------------------- 369 // TemplateURL ----------------------------------------------------------------
364 370
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 base::Time last_modified() const { return data_.last_modified; } 426 base::Time last_modified() const { return data_.last_modified; }
421 427
422 bool created_by_policy() const { return data_.created_by_policy; } 428 bool created_by_policy() const { return data_.created_by_policy; }
423 429
424 int usage_count() const { return data_.usage_count; } 430 int usage_count() const { return data_.usage_count; }
425 431
426 int prepopulate_id() const { return data_.prepopulate_id; } 432 int prepopulate_id() const { return data_.prepopulate_id; }
427 433
428 const std::string& sync_guid() const { return data_.sync_guid; } 434 const std::string& sync_guid() const { return data_.sync_guid; }
429 435
436 const std::string& search_terms_replacement_key() const {
437 return data_.search_terms_replacement_key;
438 }
439
430 const TemplateURLRef& url_ref() const { return url_ref_; } 440 const TemplateURLRef& url_ref() const { return url_ref_; }
431 const TemplateURLRef& suggestions_url_ref() const { 441 const TemplateURLRef& suggestions_url_ref() const {
432 return suggestions_url_ref_; 442 return suggestions_url_ref_;
433 } 443 }
434 const TemplateURLRef& instant_url_ref() const { return instant_url_ref_; } 444 const TemplateURLRef& instant_url_ref() const { return instant_url_ref_; }
435 445
436 // Returns true if |url| supports replacement. 446 // Returns true if |url| supports replacement.
437 bool SupportsReplacement() const; 447 bool SupportsReplacement() const;
438 448
439 // Like SupportsReplacement but usable on threads other than the UI thread. 449 // Like SupportsReplacement but usable on threads other than the UI thread.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 TemplateURLRef url_ref_; 504 TemplateURLRef url_ref_;
495 TemplateURLRef suggestions_url_ref_; 505 TemplateURLRef suggestions_url_ref_;
496 TemplateURLRef instant_url_ref_; 506 TemplateURLRef instant_url_ref_;
497 507
498 // TODO(sky): Add date last parsed OSD file. 508 // TODO(sky): Add date last parsed OSD file.
499 509
500 DISALLOW_COPY_AND_ASSIGN(TemplateURL); 510 DISALLOW_COPY_AND_ASSIGN(TemplateURL);
501 }; 511 };
502 512
503 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ 513 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698