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 #include "ios/chrome/browser/suggestions/ios_image_decoder_impl.h" | 5 #include "ios/chrome/browser/suggestions/ios_image_decoder_impl.h" |
6 | 6 |
7 #include <UIKit/UIKit.h> | 7 #include <UIKit/UIKit.h> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "ios/chrome/browser/webp_transcode/webp_decoder.h" | 14 #import "ios/web/public/image_fetcher/webp_decoder.h" |
15 #include "ios/web/public/web_thread.h" | 15 #include "ios/web/public/web_thread.h" |
16 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class WebpDecoderDelegate : public webp_transcode::WebpDecoder::Delegate { | 20 class WebpDecoderDelegate : public webp_transcode::WebpDecoder::Delegate { |
21 public: | 21 public: |
22 WebpDecoderDelegate() = default; | 22 WebpDecoderDelegate() = default; |
23 | 23 |
24 NSData* data() const { return decoded_image_; } | 24 NSData* data() const { return decoded_image_; } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 gfx::Image empty_image; | 156 gfx::Image empty_image; |
157 callback.Run(empty_image); | 157 callback.Run(empty_image); |
158 } | 158 } |
159 | 159 |
160 std::unique_ptr<image_fetcher::ImageDecoder> CreateIOSImageDecoder( | 160 std::unique_ptr<image_fetcher::ImageDecoder> CreateIOSImageDecoder( |
161 scoped_refptr<base::TaskRunner> task_runner) { | 161 scoped_refptr<base::TaskRunner> task_runner) { |
162 return base::MakeUnique<IOSImageDecoderImpl>(std::move(task_runner)); | 162 return base::MakeUnique<IOSImageDecoderImpl>(std::move(task_runner)); |
163 } | 163 } |
164 | 164 |
165 } // namespace suggestions | 165 } // namespace suggestions |
OLD | NEW |