Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2845)

Unified Diff: chrome/renderer/pepper/pepper_pdf_host.cc

Issue 19800005: Hide knowledge of webkit::ppapi::PluginDelegate from chrome. This is part of moving ppapi implement… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/pepper/pepper_pdf_host.cc
===================================================================
--- chrome/renderer/pepper/pepper_pdf_host.cc (revision 212906)
+++ chrome/renderer/pepper/pepper_pdf_host.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/printing/print_web_view_helper.h"
+#include "content/public/common/referrer.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/renderer_ppapi_host.h"
@@ -24,6 +25,7 @@
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h"
+#include "third_party/WebKit/public/web/WebView.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/layout.h"
@@ -178,7 +180,7 @@
PluginInstance* instance = host_->GetPluginInstance(pp_instance());
if (!instance)
return PP_ERROR_FAILED;
- instance->delegate()->DidStartLoading();
+ instance->render_view()->DidStartLoading();
return PP_OK;
}
@@ -187,7 +189,7 @@
PluginInstance* instance = host_->GetPluginInstance(pp_instance());
if (!instance)
return PP_ERROR_FAILED;
- instance->delegate()->DidStopLoading();
+ instance->render_view()->DidStopLoading();
return PP_OK;
}
@@ -196,7 +198,9 @@
PluginInstance* instance = host_->GetPluginInstance(pp_instance());
if (!instance)
return PP_ERROR_FAILED;
- instance->delegate()->SetContentRestriction(restrictions);
+ instance->render_view()->Send(
+ new ChromeViewHostMsg_PDFUpdateContentRestrictions(
+ instance->render_view()->GetRoutingID(), restrictions));
return PP_OK;
}
@@ -262,7 +266,13 @@
PluginInstance* instance = host_->GetPluginInstance(pp_instance());
if (!instance)
return PP_ERROR_FAILED;
- instance->delegate()->SaveURLAs(instance->plugin_url());
+ GURL url = instance->plugin_url();
+ content::RenderView* render_view = instance->render_view();
+ WebKit::WebFrame* frame = render_view->GetWebView()->mainFrame();
+ content::Referrer referrer(frame->document().url(),
+ frame->document().referrerPolicy());
+ render_view->Send(new ChromeViewHostMsg_PDFSaveURLAs(
+ render_view->GetRoutingID(), url, referrer));
return PP_OK;
}

Powered by Google App Engine
This is Rietveld 408576698