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

Side by Side Diff: content/renderer/image_downloader/single_image_downloader.h

Issue 2538853002: Media Remoting: Draw remoting interstitial on poster image. (Closed)
Patch Set: Addressed comments. Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_IMAGE_DOWNLOADER_SINGLE_IMAGE_DOWNLOADER_H_
6 #define CONTENT_RENDERER_IMAGE_DOWNLOADER_SINGLE_IMAGE_DOWNLOADER_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "content/renderer/image_downloader/image_downloader_base.h"
10
11 namespace content {
12
13 // A one time image downloader that will download a single image. When there are
14 // multiple frames, return the first one. Return an empty bitmap if downloading
15 // fails.
16 class SingleImageDownloader {
17 public:
18 using DownloadImageCallback = base::Callback<void(const SkBitmap&)>;
19
20 // Called to download the image in given |url|, and run |cb| when done.
21 // A new ImageDownloaderBase will be created and used to download the image,
22 // and will be destructed when downloading finishes or |render_frame| is
23 // destructed.
24 static void DownloadImage(base::WeakPtr<RenderFrame> render_frame,
25 const GURL& url,
26 const DownloadImageCallback& cb);
27
28 private:
29 // Callback when downloading finishes.
30 static void DidDownloadImage(
31 std::unique_ptr<ImageDownloaderBase> image_downloader,
32 const DownloadImageCallback& callback,
33 int http_status_code,
34 const std::vector<SkBitmap>& images);
35
36 DISALLOW_COPY_AND_ASSIGN(SingleImageDownloader);
37 };
38
39 } // namespace content
40
41 #endif // CONTENT_RENDERER_IMAGE_DOWNLOADER_SINGLE_IMAGE_DOWNLOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698