diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 00:16:47 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 00:16:47 +0000 |
commit | 410caed3335c728c02133a37a629b58f0b6c8286 (patch) | |
tree | c2b4091a7a7ee29e9fae64a33f12fd99fea0384d /webkit/glue/plugins | |
parent | 547591aa666ee2f4a9c141832e928511d70ddf3e (diff) | |
download | chromium_src-410caed3335c728c02133a37a629b58f0b6c8286.zip chromium_src-410caed3335c728c02133a37a629b58f0b6c8286.tar.gz chromium_src-410caed3335c728c02133a37a629b58f0b6c8286.tar.bz2 |
Add private pepper API to keep the throbber spinning while PDFs are loading.
BUG=58795
Review URL: http://codereview.chromium.org/3685003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62217 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_delegate.h | 4 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_private.cc | 21 | ||||
-rw-r--r-- | webkit/glue/plugins/ppb_private.h | 7 |
3 files changed, 31 insertions, 1 deletions
diff --git a/webkit/glue/plugins/pepper_plugin_delegate.h b/webkit/glue/plugins/pepper_plugin_delegate.h index 9483d9484..29fdfc8 100644 --- a/webkit/glue/plugins/pepper_plugin_delegate.h +++ b/webkit/glue/plugins/pepper_plugin_delegate.h @@ -211,6 +211,10 @@ class PluginDelegate { // Retrieves the proxy information for the given URL in PAC format. On error, // this will return an empty string. virtual std::string ResolveProxy(const GURL& url) = 0; + + // Tell the browser when resource loading starts/ends. + virtual void DidStartLoading() = 0; + virtual void DidStopLoading() = 0; }; } // namespace pepper diff --git a/webkit/glue/plugins/pepper_private.cc b/webkit/glue/plugins/pepper_private.cc index f12e045..e236b67f 100644 --- a/webkit/glue/plugins/pepper_private.cc +++ b/webkit/glue/plugins/pepper_private.cc @@ -11,10 +11,13 @@ #include "grit/webkit_resources.h" #include "grit/webkit_strings.h" #include "skia/ext/platform_canvas.h" +#include "third_party/ppapi/c/pp_resource.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/icu/public/i18n/unicode/usearch.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/plugins/pepper_image_data.h" +#include "webkit/glue/plugins/pepper_plugin_delegate.h" +#include "webkit/glue/plugins/pepper_plugin_instance.h" #include "webkit/glue/plugins/pepper_plugin_module.h" #include "webkit/glue/plugins/pepper_var.h" #include "webkit/glue/plugins/ppb_private.h" @@ -224,12 +227,28 @@ void SearchString(PP_Module module, usearch_close(searcher); } +void DidStartLoading(PP_Instance instance_id) { + PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); + if (!instance) + return; + instance->delegate()->DidStartLoading(); +} + +void DidStopLoading(PP_Instance instance_id) { + PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); + if (!instance) + return; + instance->delegate()->DidStopLoading(); +} + const PPB_Private ppb_private = { &GetLocalizedString, &GetResourceImage, &GetFontFileWithFallback, &GetFontTableForPrivateFontFile, - &SearchString + &SearchString, + &DidStartLoading, + &DidStopLoading }; } // namespace diff --git a/webkit/glue/plugins/ppb_private.h b/webkit/glue/plugins/ppb_private.h index 6a30dcf..378ecad 100644 --- a/webkit/glue/plugins/ppb_private.h +++ b/webkit/glue/plugins/ppb_private.h @@ -6,6 +6,7 @@ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "third_party/ppapi/c/dev/ppb_font_dev.h" +#include "third_party/ppapi/c/pp_instance.h" #include "third_party/ppapi/c/pp_module.h" #include "third_party/ppapi/c/pp_var.h" @@ -110,6 +111,12 @@ struct PPB_Private { bool case_sensitive, PP_PrivateFindResult** results, int* count); + + // Since WebFrame doesn't know about Pepper requests, it'll think the page has + // finished loading even if there are outstanding requests by the plugin. + // Take this out once WebFrame knows about requests by pepper plugins. + void (*DidStartLoading)(PP_Instance instance); + void (*DidStopLoading)(PP_Instance instance); }; #endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ |