Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 417 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, | 417 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, |
| 418 IsLocalTemplateURLBetter); | 418 IsLocalTemplateURLBetter); |
| 419 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, | 419 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, |
| 420 ResolveSyncKeywordConflict); | 420 ResolveSyncKeywordConflict); |
| 421 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, PreSyncDeletes); | 421 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, PreSyncDeletes); |
| 422 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, MergeInSyncTemplateURL); | 422 FRIEND_TEST_ALL_PREFIXES(TemplateURLServiceSyncTest, MergeInSyncTemplateURL); |
| 423 FRIEND_TEST_ALL_PREFIXES(ToolbarModelTest, GoogleBaseURL); | 423 FRIEND_TEST_ALL_PREFIXES(ToolbarModelTest, GoogleBaseURL); |
| 424 | 424 |
| 425 friend class InstantUnitTestBase; | 425 friend class InstantUnitTestBase; |
| 426 friend class TemplateURLServiceTestUtil; | 426 friend class TemplateURLServiceTestUtil; |
| 427 friend class TemplateURLServiceTest; | |
|
vasilii
2016/12/06 19:16:42
What method is the reason for this?
Alexander Yashkin
2016/12/09 08:19:52
Removed, it seems its left from previous tests att
| |
| 427 | 428 |
| 428 using GUIDToTURL = std::map<std::string, TemplateURL*>; | 429 using GUIDToTURL = std::map<std::string, TemplateURL*>; |
| 429 | 430 |
| 430 // A mapping from keywords to the corresponding TemplateURLs and their | 431 // A mapping from keywords to the corresponding TemplateURLs and their |
| 431 // meaningful keyword lengths. A keyword can appear only once here because | 432 // meaningful keyword lengths. A keyword can appear only once here because |
| 432 // there can be only one active TemplateURL associated with a given keyword. | 433 // there can be only one active TemplateURL associated with a given keyword. |
| 433 using KeywordToTURLAndMeaningfulLength = | 434 using KeywordToTURLAndMeaningfulLength = |
| 434 std::map<base::string16, TURLAndMeaningfulLength>; | 435 std::map<base::string16, TURLAndMeaningfulLength>; |
| 435 | 436 |
| 436 // A mapping from domain names to corresponding TemplateURLs and their | 437 // A mapping from domain names to corresponding TemplateURLs and their |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 TemplateURL* FindPrepopulatedTemplateURL(int prepopulated_id); | 693 TemplateURL* FindPrepopulatedTemplateURL(int prepopulated_id); |
| 693 | 694 |
| 694 // Returns the TemplateURL associated with |extension_id|, if any. | 695 // Returns the TemplateURL associated with |extension_id|, if any. |
| 695 TemplateURL* FindTemplateURLForExtension(const std::string& extension_id, | 696 TemplateURL* FindTemplateURLForExtension(const std::string& extension_id, |
| 696 TemplateURL::Type type); | 697 TemplateURL::Type type); |
| 697 | 698 |
| 698 // Finds the extension-supplied TemplateURL that matches |data|, if any. | 699 // Finds the extension-supplied TemplateURL that matches |data|, if any. |
| 699 TemplateURL* FindMatchingExtensionTemplateURL(const TemplateURLData& data, | 700 TemplateURL* FindMatchingExtensionTemplateURL(const TemplateURLData& data, |
| 700 TemplateURL::Type type); | 701 TemplateURL::Type type); |
| 701 | 702 |
| 702 // Finds the most recently-installed NORMAL_CONTROLLED_BY_EXTENSION engine | |
| 703 // that supports replacement and wants to be default, if any. Notifies the | |
| 704 // DefaultSearchManager, which might change the effective default search | |
| 705 // engine. | |
| 706 void UpdateExtensionDefaultSearchEngine(); | |
| 707 | |
| 708 | |
| 709 // ---------- Browser state related members --------------------------------- | 703 // ---------- Browser state related members --------------------------------- |
| 710 PrefService* prefs_; | 704 PrefService* prefs_; |
| 711 | 705 |
| 712 std::unique_ptr<SearchTermsData> search_terms_data_; | 706 std::unique_ptr<SearchTermsData> search_terms_data_; |
| 713 | 707 |
| 714 // ---------- Dependencies on other components ------------------------------ | 708 // ---------- Dependencies on other components ------------------------------ |
| 715 // Service used to store entries. | 709 // Service used to store entries. |
| 716 scoped_refptr<KeywordWebDataService> web_data_service_; | 710 scoped_refptr<KeywordWebDataService> web_data_service_; |
| 717 | 711 |
| 718 std::unique_ptr<TemplateURLServiceClient> client_; | 712 std::unique_ptr<TemplateURLServiceClient> client_; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 824 // Helper class to manage the default search engine. | 818 // Helper class to manage the default search engine. |
| 825 DefaultSearchManager default_search_manager_; | 819 DefaultSearchManager default_search_manager_; |
| 826 | 820 |
| 827 std::unique_ptr<GoogleURLTracker::Subscription> | 821 std::unique_ptr<GoogleURLTracker::Subscription> |
| 828 google_url_updated_subscription_; | 822 google_url_updated_subscription_; |
| 829 | 823 |
| 830 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 824 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
| 831 }; | 825 }; |
| 832 | 826 |
| 833 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 827 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
| OLD | NEW |