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_PROVIDER_LOGOS_LOGO_TRACKER_H_ | 5 #ifndef COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ |
6 #define COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ | 6 #define COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // |logo_url| is the URL from which the logo will be downloaded. If |logo_url| | 113 // |logo_url| is the URL from which the logo will be downloaded. If |logo_url| |
114 // is different than the current logo URL, any pending LogoObservers will be | 114 // is different than the current logo URL, any pending LogoObservers will be |
115 // canceled. | 115 // canceled. |
116 // | 116 // |
117 // |parse_logo_response_func| is a callback that will be used to parse the | 117 // |parse_logo_response_func| is a callback that will be used to parse the |
118 // server's response into a EncodedLogo object. |append_queryparams_func| is a | 118 // server's response into a EncodedLogo object. |append_queryparams_func| is a |
119 // callback that will return the URL from which to download the logo. | 119 // callback that will return the URL from which to download the logo. |
120 // |wants_cta| determines if the url should return a call to action image. | 120 // |wants_cta| determines if the url should return a call to action image. |
121 // Note: |parse_logo_response_func| and |append_queryparams_func| must be | 121 // Note: |parse_logo_response_func| and |append_queryparams_func| must be |
122 // suitable for running multiple times, concurrently, and on multiple threads. | 122 // suitable for running multiple times, concurrently, and on multiple threads. |
| 123 // TODO(ianwen): remove wants_cta from parameter. |
123 void SetServerAPI(const GURL& logo_url, | 124 void SetServerAPI(const GURL& logo_url, |
124 const ParseLogoResponse& parse_logo_response_func, | 125 const ParseLogoResponse& parse_logo_response_func, |
125 const AppendQueryparamsToLogoURL& append_queryparams_func, | 126 const AppendQueryparamsToLogoURL& append_queryparams_func, |
126 bool wants_cta); | 127 bool wants_cta); |
127 | 128 |
128 // Retrieves the current search provider's logo from the local cache and/or | 129 // Retrieves the current search provider's logo from the local cache and/or |
129 // over the network, and registers |observer| to be called when the cached | 130 // over the network, and registers |observer| to be called when the cached |
130 // and/or fresh logos are available. | 131 // and/or fresh logos are available. |
131 void GetLogo(LogoObserver* observer); | 132 void GetLogo(LogoObserver* observer); |
132 | 133 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 230 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
230 | 231 |
231 base::WeakPtrFactory<LogoTracker> weak_ptr_factory_; | 232 base::WeakPtrFactory<LogoTracker> weak_ptr_factory_; |
232 | 233 |
233 DISALLOW_COPY_AND_ASSIGN(LogoTracker); | 234 DISALLOW_COPY_AND_ASSIGN(LogoTracker); |
234 }; | 235 }; |
235 | 236 |
236 } // namespace search_provider_logos | 237 } // namespace search_provider_logos |
237 | 238 |
238 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ | 239 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ |
OLD | NEW |