| 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 #ifndef WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_ | 5 #ifndef WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_ |
| 6 #define WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_ | 6 #define WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "webkit/glue/resource_fetcher.h" | 9 #include "webkit/glue/resource_fetcher.h" |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 const GURL& image_url() const { return image_url_; } | 32 const GURL& image_url() const { return image_url_; } |
| 33 | 33 |
| 34 // Unique identifier for the request. | 34 // Unique identifier for the request. |
| 35 int id() const { return id_; } | 35 int id() const { return id_; } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // ResourceFetcher::Callback. Decodes the image and invokes callback_. | 38 // ResourceFetcher::Callback. Decodes the image and invokes callback_. |
| 39 void OnURLFetchComplete(const WebKit::WebURLResponse& response, | 39 void OnURLFetchComplete(const WebKit::WebURLResponse& response, |
| 40 const std::string& data); | 40 const std::string& data); |
| 41 | 41 |
| 42 Callback* callback_; | 42 scoped_ptr<Callback> callback_; |
| 43 | 43 |
| 44 // Unique identifier for the request. | 44 // Unique identifier for the request. |
| 45 const int id_; | 45 const int id_; |
| 46 | 46 |
| 47 // URL of the image. | 47 // URL of the image. |
| 48 const GURL image_url_; | 48 const GURL image_url_; |
| 49 | 49 |
| 50 // The size of the image. This is only a hint that is used if the image | 50 // The size of the image. This is only a hint that is used if the image |
| 51 // contains multiple sizes. A value of 0 results in using the first frame | 51 // contains multiple sizes. A value of 0 results in using the first frame |
| 52 // of the image. | 52 // of the image. |
| 53 const int image_size_; | 53 const int image_size_; |
| 54 | 54 |
| 55 // Does the actual download. | 55 // Does the actual download. |
| 56 scoped_ptr<ResourceFetcher> fetcher_; | 56 scoped_ptr<ResourceFetcher> fetcher_; |
| 57 | 57 |
| 58 DISALLOW_EVIL_CONSTRUCTORS(ImageResourceFetcher); | 58 DISALLOW_EVIL_CONSTRUCTORS(ImageResourceFetcher); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace webkit_glue | 61 } // namespace webkit_glue |
| 62 | 62 |
| 63 #endif // WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_ | 63 #endif // WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H_ |
| OLD | NEW |