OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/fetchers/multi_resolution_image_resource_fetcher.h" | 5 #include "content/renderer/fetchers/multi_resolution_image_resource_fetcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "content/child/image_decoder.h" | 9 #include "content/child/image_decoder.h" |
10 #include "third_party/WebKit/public/web/WebFrame.h" | 10 #include "third_party/WebKit/public/web/WebFrame.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
13 | 13 |
14 using WebKit::WebFrame; | 14 using blink::WebFrame; |
15 using WebKit::WebURLRequest; | 15 using blink::WebURLRequest; |
16 using WebKit::WebURLResponse; | 16 using blink::WebURLResponse; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 MultiResolutionImageResourceFetcher::MultiResolutionImageResourceFetcher( | 20 MultiResolutionImageResourceFetcher::MultiResolutionImageResourceFetcher( |
21 const GURL& image_url, | 21 const GURL& image_url, |
22 WebFrame* frame, | 22 WebFrame* frame, |
23 int id, | 23 int id, |
24 WebURLRequest::TargetType target_type, | 24 WebURLRequest::TargetType target_type, |
25 const Callback& callback) | 25 const Callback& callback) |
26 : callback_(callback), | 26 : callback_(callback), |
(...skipping 27 matching lines...) Expand all Loading... |
54 // If we get here, it means no image from server or couldn't decode the | 54 // If we get here, it means no image from server or couldn't decode the |
55 // response as an image. The delegate will see an empty vector. | 55 // response as an image. The delegate will see an empty vector. |
56 | 56 |
57 // Take a reference to the callback as running the callback may lead to our | 57 // Take a reference to the callback as running the callback may lead to our |
58 // destruction. | 58 // destruction. |
59 Callback callback = callback_; | 59 Callback callback = callback_; |
60 callback.Run(this, bitmaps); | 60 callback.Run(this, bitmaps); |
61 } | 61 } |
62 | 62 |
63 } // namespace content | 63 } // namespace content |
OLD | NEW |