From e14c959126431fed79d444f5d33c3bd508b20663 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Fri, 13 Jan 2012 16:58:25 +0000 Subject: Start splitting out WebUI into an implementation class and an interface that each page implements. This first patch moves the virtual functions in WebUI that were overridden by pages into a separate interface, content::WebUIController. BUG=98716 Review URL: http://codereview.chromium.org/9188056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117645 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/chrome_ppb_pdf_impl.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'chrome/renderer/chrome_ppb_pdf_impl.cc') diff --git a/chrome/renderer/chrome_ppb_pdf_impl.cc b/chrome/renderer/chrome_ppb_pdf_impl.cc index 880d8c2..ba7e127 100644 --- a/chrome/renderer/chrome_ppb_pdf_impl.cc +++ b/chrome/renderer/chrome_ppb_pdf_impl.cc @@ -9,6 +9,7 @@ #include "build/build_config.h" #include "chrome/common/render_messages.h" #include "content/public/common/child_process_sandbox_support_linux.h" +#include "content/public/common/content_client.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" #include "grit/webkit_resources.h" @@ -123,7 +124,8 @@ static const ResourceImageInfo kResourceImageMap[] = { PP_Var GetLocalizedString(PP_Instance instance_id, PP_ResourceString string_id) { - PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); + PluginInstance* instance = + content::GetHostGlobals()->GetInstance(instance_id); if (!instance) return PP_MakeUndefined(); @@ -159,7 +161,7 @@ PP_Resource GetResourceImage(PP_Instance instance_id, ResourceBundle::GetSharedInstance().GetBitmapNamed(res_id); // Validate the instance. - if (!HostGlobals::Get()->GetInstance(instance_id)) + if (!content::GetHostGlobals()->GetInstance(instance_id)) return 0; scoped_refptr image_data( new webkit::ppapi::PPB_ImageData_Impl(instance_id)); @@ -187,7 +189,7 @@ PP_Resource GetFontFileWithFallback( PP_PrivateFontCharset charset) { #if defined(OS_LINUX) || defined(OS_OPENBSD) // Validate the instance before using it below. - if (!HostGlobals::Get()->GetInstance(instance_id)) + if (!content::GetHostGlobals()->GetInstance(instance_id)) return 0; scoped_refptr face_name(ppapi::StringVar::FromPPVar( @@ -281,21 +283,23 @@ void SearchString(PP_Instance instance, } void DidStartLoading(PP_Instance instance_id) { - PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); + PluginInstance* instance = content::GetHostGlobals()->GetInstance(instance_id); if (!instance) return; instance->delegate()->DidStartLoading(); } void DidStopLoading(PP_Instance instance_id) { - PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); + PluginInstance* instance = + content::GetHostGlobals()->GetInstance(instance_id); if (!instance) return; instance->delegate()->DidStopLoading(); } void SetContentRestriction(PP_Instance instance_id, int restrictions) { - PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); + PluginInstance* instance = + content::GetHostGlobals()->GetInstance(instance_id); if (!instance) return; instance->delegate()->SetContentRestriction(restrictions); @@ -313,7 +317,8 @@ void UserMetricsRecordAction(PP_Var action) { } void HasUnsupportedFeature(PP_Instance instance_id) { - PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); + PluginInstance* instance = + content::GetHostGlobals()->GetInstance(instance_id); if (!instance) return; @@ -328,7 +333,8 @@ void HasUnsupportedFeature(PP_Instance instance_id) { } void SaveAs(PP_Instance instance_id) { - PluginInstance* instance = HostGlobals::Get()->GetInstance(instance_id); + PluginInstance* instance = + content::GetHostGlobals()->GetInstance(instance_id); if (!instance) return; instance->delegate()->SaveURLAs(instance->plugin_url()); -- cgit v1.1