summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view.h
diff options
context:
space:
mode:
authoryaar@chromium.org <yaar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 23:16:17 +0000
committeryaar@chromium.org <yaar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 23:16:17 +0000
commitb0950a734d693e2192b1e2e94381c4345387b330 (patch)
treea05449073fff162deedcec67838f60a2809efda0 /chrome/renderer/render_view.h
parent0aaec000440c2453f20265a7b580efc4ad10b282 (diff)
downloadchromium_src-b0950a734d693e2192b1e2e94381c4345387b330.zip
chromium_src-b0950a734d693e2192b1e2e94381c4345387b330.tar.gz
chromium_src-b0950a734d693e2192b1e2e94381c4345387b330.tar.bz2
WebView::DownloadImage refactored
The implementation was dependent on webkit_glue::image_resource_fetcher and had to be removed if we want to upstream WebView. DownloadImage has been moved into RenderView::DownloadImage. WebViewImpl's set of ImageResourceFetchers has been ripped off and moved into RenderView. Review URL: http://codereview.chromium.org/255006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.h')
-rw-r--r--chrome/renderer/render_view.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index ae0732a..fd12078a 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -37,6 +37,7 @@
#include "webkit/api/public/WebTextDirection.h"
#include "webkit/glue/dom_serializer_delegate.h"
#include "webkit/glue/form_data.h"
+#include "webkit/glue/image_resource_fetcher.h"
#include "webkit/glue/password_form_dom_manager.h"
#include "webkit/glue/webaccessibilitymanager.h"
#include "webkit/glue/webplugin_page_delegate.h"
@@ -177,10 +178,6 @@ class RenderView : public RenderWidget,
virtual void OnMissingPluginStatus(
WebPluginDelegateProxy* delegate,
int status);
- virtual void DidDownloadImage(int id,
- const GURL& image_url,
- bool errored,
- const SkBitmap& image);
virtual void ShowContextMenu(WebView* webview,
ContextNodeType node_type,
int x,
@@ -686,6 +683,19 @@ class RenderView : public RenderWidget,
// Locates a sub frame with given xpath
WebKit::WebFrame* GetChildFrame(const std::wstring& frame_xpath) const;
+ // Requests to download an image. When done, the RenderView is
+ // notified by way of DidDownloadImage. Returns true if the request was
+ // successfully started, false otherwise. id is used to uniquely identify the
+ // request and passed back to the DidDownloadImage method. If the image has
+ // multiple frames, the frame whose size is image_size is returned. If the
+ // image doesn't have a frame at the specified size, the first is returned.
+ bool DownloadImage(int id, const GURL& image_url, int image_size);
+
+ // This callback is triggered when DownloadImage completes, either
+ // succesfully or with a failure. See DownloadImage for more details.
+ void DidDownloadImage(webkit_glue::ImageResourceFetcher* fetcher,
+ const SkBitmap& image);
+
enum ErrorPageType {
DNS_ERROR,
HTTP_404,
@@ -954,6 +964,11 @@ class RenderView : public RenderWidget,
// Shall be cleared as soon as the next key event is processed.
EditCommands edit_commands_;
+ // ImageResourceFetchers schedule via DownloadImage.
+ typedef std::set<webkit_glue::ImageResourceFetcher*> ImageResourceFetcherSet;
+ ImageResourceFetcherSet image_fetchers_;
+
+
DISALLOW_COPY_AND_ASSIGN(RenderView);
};