| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "webkit/glue/image_resource_fetcher.h" | 5 #include "webkit/glue/image_resource_fetcher.h" |
| 6 | 6 |
| 7 #include "base/gfx/size.h" | 7 #include "base/gfx/size.h" |
| 8 #include "webkit/api/public/WebFrame.h" |
| 8 #include "webkit/glue/image_decoder.h" | 9 #include "webkit/glue/image_decoder.h" |
| 9 #include "webkit/glue/webframe.h" | |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| 11 | 11 |
| 12 using WebKit::WebFrame; |
| 13 |
| 12 namespace webkit_glue { | 14 namespace webkit_glue { |
| 13 | 15 |
| 14 ImageResourceFetcher::ImageResourceFetcher( | 16 ImageResourceFetcher::ImageResourceFetcher( |
| 15 const GURL& image_url, | 17 const GURL& image_url, |
| 16 WebFrame* frame, | 18 WebFrame* frame, |
| 17 int id, | 19 int id, |
| 18 int image_size, | 20 int image_size, |
| 19 Callback* callback) | 21 Callback* callback) |
| 20 : callback_(callback), | 22 : callback_(callback), |
| 21 id_(id), | 23 id_(id), |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 reinterpret_cast<const unsigned char*>(data.data()), data.size()); | 44 reinterpret_cast<const unsigned char*>(data.data()), data.size()); |
| 43 } // else case: | 45 } // else case: |
| 44 // If we get here, it means no image from server or couldn't decode the | 46 // If we get here, it means no image from server or couldn't decode the |
| 45 // response as an image. The delegate will see a null image, indicating | 47 // response as an image. The delegate will see a null image, indicating |
| 46 // that an error occurred. | 48 // that an error occurred. |
| 47 callback_->Run(this, bitmap); | 49 callback_->Run(this, bitmap); |
| 48 callback_.reset(); | 50 callback_.reset(); |
| 49 } | 51 } |
| 50 | 52 |
| 51 } // namespace webkit_glue | 53 } // namespace webkit_glue |
| OLD | NEW |