| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_ |
| 6 #define CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_ | 6 #define CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "chrome/browser/image_decoder.h" | 11 #include "chrome/browser/image_decoder.h" |
| 12 #include "components/image_fetcher/image_decoder.h" | 12 #include "components/image_fetcher/image_decoder.h" |
| 13 | 13 |
| 14 class SkBitmap; | |
| 15 | |
| 16 namespace suggestions { | 14 namespace suggestions { |
| 17 | 15 |
| 18 // image_fetcher::ImageDecoder Implementation. | 16 // image_fetcher::ImageDecoder Implementation. |
| 19 class ImageDecoderImpl : public image_fetcher::ImageDecoder { | 17 class ImageDecoderImpl : public image_fetcher::ImageDecoder { |
| 20 public: | 18 public: |
| 21 ImageDecoderImpl(); | 19 ImageDecoderImpl(); |
| 22 ~ImageDecoderImpl() override; | 20 ~ImageDecoderImpl() override; |
| 23 | 21 |
| 24 void DecodeImage( | 22 void DecodeImage( |
| 25 const std::string& image_data, | 23 const std::string& image_data, |
| 26 const image_fetcher::ImageDecodedCallback& callback) override; | 24 const image_fetcher::ImageDecodedCallback& callback) override; |
| 27 | 25 |
| 28 private: | 26 private: |
| 29 class DecodeImageRequest; | 27 class DecodeImageRequest; |
| 30 | 28 |
| 31 // Removes the passed image decode |request| from the internal request queue. | 29 // Removes the passed image decode |request| from the internal request queue. |
| 32 void RemoveDecodeImageRequest(DecodeImageRequest* request); | 30 void RemoveDecodeImageRequest(DecodeImageRequest* request); |
| 33 | 31 |
| 34 // All active image decoding requests. | 32 // All active image decoding requests. |
| 35 std::vector<std::unique_ptr<DecodeImageRequest>> decode_image_requests_; | 33 std::vector<std::unique_ptr<DecodeImageRequest>> decode_image_requests_; |
| 36 | 34 |
| 37 DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl); | 35 DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl); |
| 38 }; | 36 }; |
| 39 | 37 |
| 40 } // namespace suggestions | 38 } // namespace suggestions |
| 41 | 39 |
| 42 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_ | 40 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_ |
| 43 | 41 |
| OLD | NEW |