| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // Parses the response from the server and returns it as an EncodedLogo. Returns | 70 // Parses the response from the server and returns it as an EncodedLogo. Returns |
| 71 // NULL if the response is invalid. | 71 // NULL if the response is invalid. |
| 72 typedef base::Callback<std::unique_ptr<EncodedLogo>( | 72 typedef base::Callback<std::unique_ptr<EncodedLogo>( |
| 73 const std::unique_ptr<std::string>& response, | 73 const std::unique_ptr<std::string>& response, |
| 74 base::Time response_time, | 74 base::Time response_time, |
| 75 bool* parsing_failed)> | 75 bool* parsing_failed)> |
| 76 ParseLogoResponse; | 76 ParseLogoResponse; |
| 77 | 77 |
| 78 // Encodes the fingerprint of the cached logo in the logo URL. This enables the | 78 // Encodes the fingerprint of the cached logo in the logo URL. This enables the |
| 79 // server to verify whether the cached logo is up-to-date. | 79 // server to verify whether the cached logo is up to date. |
| 80 typedef base::Callback<GURL(const GURL& logo_url, | 80 typedef base::Callback<GURL(const GURL& logo_url, |
| 81 const std::string& fingerprint, | 81 const std::string& fingerprint, |
| 82 bool wants_cta, | 82 bool wants_cta, |
| 83 bool transparent)> AppendQueryparamsToLogoURL; | 83 bool transparent)> AppendQueryparamsToLogoURL; |
| 84 | 84 |
| 85 // This class provides the logo for a search provider. Logos are downloaded from | 85 // This class provides the logo for a search provider. Logos are downloaded from |
| 86 // the search provider's logo URL and cached on disk. | 86 // the search provider's logo URL and cached on disk. |
| 87 // | 87 // |
| 88 // Call SetServerAPI() at least once to specify how to get the logo from the | 88 // Call SetServerAPI() at least once to specify how to get the logo from the |
| 89 // server. Then call GetLogo() to trigger retrieval of the logo and receive | 89 // server. Then call GetLogo() to trigger retrieval of the logo and receive |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 263 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 264 | 264 |
| 265 base::WeakPtrFactory<LogoTracker> weak_ptr_factory_; | 265 base::WeakPtrFactory<LogoTracker> weak_ptr_factory_; |
| 266 | 266 |
| 267 DISALLOW_COPY_AND_ASSIGN(LogoTracker); | 267 DISALLOW_COPY_AND_ASSIGN(LogoTracker); |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 } // namespace search_provider_logos | 270 } // namespace search_provider_logos |
| 271 | 271 |
| 272 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ | 272 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ |
| OLD | NEW |