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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
| 8 #include "base/callback.h" |
8 #include "chrome/browser/search/suggestions/image_decoder_impl.h" | 9 #include "chrome/browser/search/suggestions/image_decoder_impl.h" |
9 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
10 | 11 |
11 namespace suggestions { | 12 namespace suggestions { |
12 | 13 |
13 // A request for decoding an image. | 14 // A request for decoding an image. |
14 class ImageDecoderImpl::DecodeImageRequest | 15 class ImageDecoderImpl::DecodeImageRequest |
15 : public ::ImageDecoder::ImageRequest { | 16 : public ::ImageDecoder::ImageRequest { |
16 public: | 17 public: |
17 DecodeImageRequest(ImageDecoderImpl* decoder, | 18 DecodeImageRequest(ImageDecoderImpl* decoder, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 std::find_if(decode_image_requests_.begin(), | 80 std::find_if(decode_image_requests_.begin(), |
80 decode_image_requests_.end(), | 81 decode_image_requests_.end(), |
81 [request](const std::unique_ptr<DecodeImageRequest>& r) { | 82 [request](const std::unique_ptr<DecodeImageRequest>& r) { |
82 return r.get() == request; | 83 return r.get() == request; |
83 }); | 84 }); |
84 DCHECK(request_it != decode_image_requests_.end()); | 85 DCHECK(request_it != decode_image_requests_.end()); |
85 decode_image_requests_.erase(request_it); | 86 decode_image_requests_.erase(request_it); |
86 } | 87 } |
87 | 88 |
88 } // namespace suggestions | 89 } // namespace suggestions |
OLD | NEW |