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

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

Issue 2538853002: Media Remoting: Draw remoting interstitial on poster image. (Closed)
Patch Set: Removed the change to update/show interstial from this CL. 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 2015 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 #include "content/renderer/image_downloader/single_image_downloader.h"
6
7 #include "base/bind.h"
8 #include "base/logging.h"
9
10 namespace content {
11
12 // Static
13 void SingleImageDownloader::DownloadImage(RenderFrame* render_frame,
14 const GURL& url,
15 const DownloadImageCallback& cb) {
16 DCHECK(!cb.is_null());
17 DCHECK(render_frame);
18
19 std::unique_ptr<ImageDownloaderBase> image_downloader(
20 new ImageDownloaderBase(render_frame));
21 ImageDownloaderBase* image_downloader_ptr = image_downloader.get();
22 image_downloader_ptr->DownloadImage(
23 url, false, false, base::Bind(&SingleImageDownloader::DidDownloadImage,
24 base::Passed(&image_downloader), cb));
25 }
26
27 // Static
28 void SingleImageDownloader::DidDownloadImage(
29 std::unique_ptr<ImageDownloaderBase> image_downloader,
30 const DownloadImageCallback& callback,
31 int http_status_code,
32 const std::vector<SkBitmap>& images) {
33 DCHECK(!callback.is_null());
34 callback.Run(images.empty() ? SkBitmap() : images[0]);
35 }
36
37 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698