Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: chrome/browser/search/suggestions/image_decoder_impl.h

Issue 2715153006: Set desired_image_size when decoding images for NTP Tile icons. (Closed)
Patch Set: ax Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 namespace suggestions { 14 namespace suggestions {
15 15
16 // image_fetcher::ImageDecoder Implementation. 16 // image_fetcher::ImageDecoder Implementation.
17 class ImageDecoderImpl : public image_fetcher::ImageDecoder { 17 class ImageDecoderImpl : public image_fetcher::ImageDecoder {
18 public: 18 public:
19 ImageDecoderImpl(); 19 ImageDecoderImpl();
20 ~ImageDecoderImpl() override; 20 ~ImageDecoderImpl() override;
21 21
22 void DecodeImage( 22 void DecodeImage(
23 const std::string& image_data, 23 const std::string& image_data,
24 const gfx::Size& desired_image_frame_size,
24 const image_fetcher::ImageDecodedCallback& callback) override; 25 const image_fetcher::ImageDecodedCallback& callback) override;
Marc Treib 2017/03/01 09:17:26 Hm, one high-level comment: This returns a gfx::Im
tschumann 2017/03/01 09:37:43 I totally agree -- just that's how the whole image
Marc Treib 2017/03/01 09:41:56 I think in terms of API, it would actually be a sm
tschumann 2017/03/01 11:36:36 I agree. I'm mostly concerned about changing seman
25 26
26 private: 27 private:
27 class DecodeImageRequest; 28 class DecodeImageRequest;
28 29
29 // Removes the passed image decode |request| from the internal request queue. 30 // Removes the passed image decode |request| from the internal request queue.
30 void RemoveDecodeImageRequest(DecodeImageRequest* request); 31 void RemoveDecodeImageRequest(DecodeImageRequest* request);
31 32
32 // All active image decoding requests. 33 // All active image decoding requests.
33 std::vector<std::unique_ptr<DecodeImageRequest>> decode_image_requests_; 34 std::vector<std::unique_ptr<DecodeImageRequest>> decode_image_requests_;
34 35
35 DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl); 36 DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl);
36 }; 37 };
37 38
38 } // namespace suggestions 39 } // namespace suggestions
39 40
40 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_ 41 #endif // CHROME_BROWSER_SEARCH_SUGGESTIONS_IMAGE_DECODER_IMPL_H_
41 42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698