| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_ | |
| 6 #define COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 namespace gfx { | |
| 13 class Image; | |
| 14 } | |
| 15 | |
| 16 namespace image_fetcher { | |
| 17 | |
| 18 class ImageFetcherDelegate { | |
| 19 public: | |
| 20 ImageFetcherDelegate() {} | |
| 21 | |
| 22 // Called when the data for an image was fetched. |id| is an identifier for | |
| 23 // the fetch (as passed to ImageFetcher::StartOrQueueNetworkRequest); |data| | |
| 24 // stores (generally compressed) image data owned by the caller, and can be | |
| 25 // empty if the fetch failed. | |
| 26 virtual void OnImageDataFetched(const std::string& id, | |
| 27 const std::string& data) {}; | |
| 28 | |
| 29 // Called when an image was fetched and decoded. |id| is an identifier for the | |
| 30 // fetch (as passed to ImageFetcher::StartOrQueueNetworkRequest); |image| | |
| 31 // stores image data owned by the caller, and can be an empty gfx::Image. | |
| 32 virtual void OnImageFetched(const std::string& id, | |
| 33 const gfx::Image& image) {}; | |
| 34 | |
| 35 protected: | |
| 36 virtual ~ImageFetcherDelegate() {} | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(ImageFetcherDelegate); | |
| 39 }; | |
| 40 | |
| 41 } // namespace image_fetcher | |
| 42 | |
| 43 #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_ | |
| OLD | NEW |