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 23 matching lines...) Expand all Loading... |
34 class GURL; | 34 class GURL; |
35 class PrefService; | 35 class PrefService; |
36 class SearchHostToURLsMap; | 36 class SearchHostToURLsMap; |
37 class SearchTermsData; | 37 class SearchTermsData; |
38 class TemplateURL; | 38 class TemplateURL; |
39 class TemplateURLServiceClient; | 39 class TemplateURLServiceClient; |
40 class TemplateURLServiceObserver; | 40 class TemplateURLServiceObserver; |
41 struct TemplateURLData; | 41 struct TemplateURLData; |
42 | 42 |
43 namespace rappor { | 43 namespace rappor { |
44 class RapporService; | 44 class RapporServiceImpl; |
45 } | 45 } |
46 | 46 |
47 namespace syncer { | 47 namespace syncer { |
48 class SyncData; | 48 class SyncData; |
49 class SyncErrorFactory; | 49 class SyncErrorFactory; |
50 } | 50 } |
51 | 51 |
52 namespace user_prefs { | 52 namespace user_prefs { |
53 class PrefRegistrySyncable; | 53 class PrefRegistrySyncable; |
54 } | 54 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 GURL url; | 102 GURL url; |
103 bool is_keyword_transition; | 103 bool is_keyword_transition; |
104 }; | 104 }; |
105 | 105 |
106 TemplateURLService( | 106 TemplateURLService( |
107 PrefService* prefs, | 107 PrefService* prefs, |
108 std::unique_ptr<SearchTermsData> search_terms_data, | 108 std::unique_ptr<SearchTermsData> search_terms_data, |
109 const scoped_refptr<KeywordWebDataService>& web_data_service, | 109 const scoped_refptr<KeywordWebDataService>& web_data_service, |
110 std::unique_ptr<TemplateURLServiceClient> client, | 110 std::unique_ptr<TemplateURLServiceClient> client, |
111 GoogleURLTracker* google_url_tracker, | 111 GoogleURLTracker* google_url_tracker, |
112 rappor::RapporService* rappor_service, | 112 rappor::RapporServiceImpl* rappor_service, |
113 const base::Closure& dsp_change_callback); | 113 const base::Closure& dsp_change_callback); |
114 // The following is for testing. | 114 // The following is for testing. |
115 TemplateURLService(const Initializer* initializers, const int count); | 115 TemplateURLService(const Initializer* initializers, const int count); |
116 ~TemplateURLService() override; | 116 ~TemplateURLService() override; |
117 | 117 |
118 // Register Profile preferences in |registry|. | 118 // Register Profile preferences in |registry|. |
119 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 119 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
120 | 120 |
121 // Removes any unnecessary characters from a user input keyword. | 121 // Removes any unnecessary characters from a user input keyword. |
122 // This removes the leading scheme, "www." and any trailing slash. | 122 // This removes the leading scheme, "www." and any trailing slash. |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 | 721 |
722 // ---------- Dependencies on other components ------------------------------ | 722 // ---------- Dependencies on other components ------------------------------ |
723 // Service used to store entries. | 723 // Service used to store entries. |
724 scoped_refptr<KeywordWebDataService> web_data_service_; | 724 scoped_refptr<KeywordWebDataService> web_data_service_; |
725 | 725 |
726 std::unique_ptr<TemplateURLServiceClient> client_; | 726 std::unique_ptr<TemplateURLServiceClient> client_; |
727 | 727 |
728 GoogleURLTracker* google_url_tracker_; | 728 GoogleURLTracker* google_url_tracker_; |
729 | 729 |
730 // ---------- Metrics related members --------------------------------------- | 730 // ---------- Metrics related members --------------------------------------- |
731 rappor::RapporService* rappor_service_; | 731 rappor::RapporServiceImpl* rappor_service_; |
732 | 732 |
733 // This closure is run when the default search provider is set to Google. | 733 // This closure is run when the default search provider is set to Google. |
734 base::Closure dsp_change_callback_; | 734 base::Closure dsp_change_callback_; |
735 | 735 |
736 | 736 |
737 PrefChangeRegistrar pref_change_registrar_; | 737 PrefChangeRegistrar pref_change_registrar_; |
738 | 738 |
739 // Mapping from keyword to the TemplateURL. | 739 // Mapping from keyword to the TemplateURL. |
740 KeywordToTURLAndMeaningfulLength keyword_to_turl_and_length_; | 740 KeywordToTURLAndMeaningfulLength keyword_to_turl_and_length_; |
741 | 741 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // Helper class to manage the default search engine. | 832 // Helper class to manage the default search engine. |
833 DefaultSearchManager default_search_manager_; | 833 DefaultSearchManager default_search_manager_; |
834 | 834 |
835 std::unique_ptr<GoogleURLTracker::Subscription> | 835 std::unique_ptr<GoogleURLTracker::Subscription> |
836 google_url_updated_subscription_; | 836 google_url_updated_subscription_; |
837 | 837 |
838 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); | 838 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); |
839 }; | 839 }; |
840 | 840 |
841 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ | 841 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ |
OLD | NEW |