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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // observers is the responsibility of the caller. Returns whether | 439 // observers is the responsibility of the caller. Returns whether |
440 // |existing_turl| was found in |template_urls_| and thus could be updated. | 440 // |existing_turl| was found in |template_urls_| and thus could be updated. |
441 // |old_search_terms_data| is passed to SearchHostToURLsMap::Remove(). | 441 // |old_search_terms_data| is passed to SearchHostToURLsMap::Remove(). |
442 // | 442 // |
443 // NOTE: This should not be called with an extension keyword as there are no | 443 // NOTE: This should not be called with an extension keyword as there are no |
444 // updates needed in that case. | 444 // updates needed in that case. |
445 bool UpdateNoNotify(TemplateURL* existing_turl, | 445 bool UpdateNoNotify(TemplateURL* existing_turl, |
446 const TemplateURL& new_values, | 446 const TemplateURL& new_values, |
447 const SearchTermsData& old_search_terms_data); | 447 const SearchTermsData& old_search_terms_data); |
448 | 448 |
| 449 // If the TemplateURL comes from a prepopulated URL available in the current |
| 450 // country, update all its fields save for the keyword, short name and id so |
| 451 // that they match the internal prepopulated URL. TemplateURLs not coming from |
| 452 // a prepopulated URL are not modified. |
| 453 static void UpdateTemplateURLIfPrepopulated(TemplateURL* existing_turl, |
| 454 Profile* profile); |
| 455 |
449 // Returns the preferences we use. | 456 // Returns the preferences we use. |
450 PrefService* GetPrefs(); | 457 PrefService* GetPrefs(); |
451 | 458 |
452 // Iterates through the TemplateURLs to see if one matches the visited url. | 459 // Iterates through the TemplateURLs to see if one matches the visited url. |
453 // For each TemplateURL whose url matches the visited url | 460 // For each TemplateURL whose url matches the visited url |
454 // SetKeywordSearchTermsForURL is invoked. | 461 // SetKeywordSearchTermsForURL is invoked. |
455 void UpdateKeywordSearchTermsForURL( | 462 void UpdateKeywordSearchTermsForURL( |
456 const history::URLVisitedDetails& details); | 463 const history::URLVisitedDetails& details); |
457 | 464 |
458 // If necessary, generates a visit for the site http:// + t_url.keyword(). | 465 // If necessary, generates a visit for the site http:// + t_url.keyword(). |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 | 676 |
670 // This is used to log the origin of changes to the default search provider. | 677 // This is used to log the origin of changes to the default search provider. |
671 // We set this value to increasingly specific values when we know what is the | 678 // We set this value to increasingly specific values when we know what is the |
672 // cause/origin of a default search change. | 679 // cause/origin of a default search change. |
673 DefaultSearchChangeOrigin dsp_change_origin_; | 680 DefaultSearchChangeOrigin dsp_change_origin_; |
674 | 681 |
675 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 682 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
676 }; | 683 }; |
677 | 684 |
678 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 685 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
OLD | NEW |