| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 // Updates the metadata for the logo already stored in the cache. | 188 // Updates the metadata for the logo already stored in the cache. |
| 189 void SetCachedMetadata(const LogoMetadata& metadata); | 189 void SetCachedMetadata(const LogoMetadata& metadata); |
| 190 | 190 |
| 191 // Starts fetching the current logo over the network. | 191 // Starts fetching the current logo over the network. |
| 192 void FetchLogo(); | 192 void FetchLogo(); |
| 193 | 193 |
| 194 // Called when the logo has been downloaded and parsed. |logo| will be NULL | 194 // Called when the logo has been downloaded and parsed. |logo| will be NULL |
| 195 // if the server's response was invalid. | 195 // if the server's response was invalid. |
| 196 void OnFreshLogoParsed(bool* parsing_failed, | 196 void OnFreshLogoParsed(bool* parsing_failed, |
| 197 bool from_http_cache, |
| 197 std::unique_ptr<EncodedLogo> logo); | 198 std::unique_ptr<EncodedLogo> logo); |
| 198 | 199 |
| 199 // Called when the fresh logo has been decoded into an SkBitmap. |image| will | 200 // Called when the fresh logo has been decoded into an SkBitmap. |image| will |
| 200 // be NULL if decoding failed. | 201 // be NULL if decoding failed. |
| 201 void OnFreshLogoAvailable(std::unique_ptr<EncodedLogo> logo, | 202 void OnFreshLogoAvailable(std::unique_ptr<EncodedLogo> logo, |
| 202 bool parsing_failed, | 203 bool parsing_failed, |
| 204 bool from_http_cache, |
| 203 const SkBitmap& image); | 205 const SkBitmap& image); |
| 204 | 206 |
| 205 // net::URLFetcherDelegate: | 207 // net::URLFetcherDelegate: |
| 206 void OnURLFetchComplete(const net::URLFetcher* source) override; | 208 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 207 void OnURLFetchDownloadProgress(const net::URLFetcher* source, | 209 void OnURLFetchDownloadProgress(const net::URLFetcher* source, |
| 208 int64_t current, | 210 int64_t current, |
| 209 int64_t total, | 211 int64_t total, |
| 210 int64_t current_network_bytes) override; | 212 int64_t current_network_bytes) override; |
| 211 | 213 |
| 212 // The URL from which the logo is fetched. | 214 // The URL from which the logo is fetched. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 268 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 267 | 269 |
| 268 base::WeakPtrFactory<LogoTracker> weak_ptr_factory_; | 270 base::WeakPtrFactory<LogoTracker> weak_ptr_factory_; |
| 269 | 271 |
| 270 DISALLOW_COPY_AND_ASSIGN(LogoTracker); | 272 DISALLOW_COPY_AND_ASSIGN(LogoTracker); |
| 271 }; | 273 }; |
| 272 | 274 |
| 273 } // namespace search_provider_logos | 275 } // namespace search_provider_logos |
| 274 | 276 |
| 275 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ | 277 #endif // COMPONENTS_SEARCH_PROVIDER_LOGOS_LOGO_TRACKER_H_ |
| OLD | NEW |