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 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #import "base/mac/bind_objc_block.h" | 10 #import "base/mac/bind_objc_block.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 #import "ios/web/public/image_fetcher/webp_decoder.h" | 14 #import "components/image_fetcher/ios/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 #if !defined(__has_feature) || !__has_feature(objc_arc) | 18 #if !defined(__has_feature) || !__has_feature(objc_arc) |
19 #error "This file requires ARC support." | 19 #error "This file requires ARC support." |
20 #endif | 20 #endif |
21 | 21 |
22 namespace suggestions { | 22 namespace suggestions { |
23 | 23 |
24 class IOSImageDecoderImpl : public image_fetcher::ImageDecoder { | 24 class IOSImageDecoderImpl : public image_fetcher::ImageDecoder { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 gfx::Image empty_image; | 95 gfx::Image empty_image; |
96 callback.Run(empty_image); | 96 callback.Run(empty_image); |
97 } | 97 } |
98 | 98 |
99 std::unique_ptr<image_fetcher::ImageDecoder> CreateIOSImageDecoder( | 99 std::unique_ptr<image_fetcher::ImageDecoder> CreateIOSImageDecoder( |
100 scoped_refptr<base::TaskRunner> task_runner) { | 100 scoped_refptr<base::TaskRunner> task_runner) { |
101 return base::MakeUnique<IOSImageDecoderImpl>(std::move(task_runner)); | 101 return base::MakeUnique<IOSImageDecoderImpl>(std::move(task_runner)); |
102 } | 102 } |
103 | 103 |
104 } // namespace suggestions | 104 } // namespace suggestions |
OLD | NEW |