#include "content/renderer/pepper/npobject_var.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/render_view_impl.h"
+#include "content/renderer/render_frame_impl.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/var_tracker.h"
#include "third_party/WebKit/public/platform/WebPoint.h"
#include "url/gurl.h"
using ppapi::NPObjectVar;
-using WebKit::WebCanvas;
-using WebKit::WebPlugin;
-using WebKit::WebPluginContainer;
-using WebKit::WebPluginParams;
-using WebKit::WebPoint;
-using WebKit::WebPrintParams;
-using WebKit::WebRect;
-using WebKit::WebSize;
-using WebKit::WebString;
-using WebKit::WebURL;
-using WebKit::WebVector;
+using blink::WebCanvas;
+using blink::WebPlugin;
+using blink::WebPluginContainer;
+using blink::WebPluginParams;
+using blink::WebPoint;
+using blink::WebPrintParams;
+using blink::WebRect;
+using blink::WebSize;
+using blink::WebString;
+using blink::WebURL;
+using blink::WebVector;
namespace content {
struct PepperWebPluginImpl::InitData {
scoped_refptr<PluginModule> module;
- base::WeakPtr<RenderViewImpl> render_view;
+ RenderFrameImpl* render_frame;
std::vector<std::string> arg_names;
std::vector<std::string> arg_values;
GURL url;
PepperWebPluginImpl::PepperWebPluginImpl(
PluginModule* plugin_module,
const WebPluginParams& params,
- const base::WeakPtr<RenderViewImpl>& render_view)
+ RenderFrameImpl* render_frame)
: init_data_(new InitData()),
full_frame_(params.loadManually),
instance_object_(PP_MakeUndefined()),
container_(NULL) {
DCHECK(plugin_module);
init_data_->module = plugin_module;
- init_data_->render_view = render_view;
+ init_data_->render_frame = render_frame;
for (size_t i = 0; i < params.attributeNames.size(); ++i) {
init_data_->arg_names.push_back(params.attributeNames[i].utf8());
init_data_->arg_values.push_back(params.attributeValues[i].utf8());
PepperWebPluginImpl::~PepperWebPluginImpl() {
}
-WebKit::WebPluginContainer* PepperWebPluginImpl::container() const {
+blink::WebPluginContainer* PepperWebPluginImpl::container() const {
return container_;
}
bool PepperWebPluginImpl::initialize(WebPluginContainer* container) {
// The plugin delegate may have gone away.
instance_ = init_data_->module->CreateInstance(
- init_data_->render_view.get(), container, init_data_->url);
+ init_data_->render_frame, container, init_data_->url);
if (!instance_.get())
return false;
instance_->Delete();
instance_ = NULL;
- WebKit::WebPlugin* replacement_plugin =
+ blink::WebPlugin* replacement_plugin =
GetContentClient()->renderer()->CreatePluginReplacement(
- init_data_->render_view.get(), init_data_->module->path());
+ init_data_->render_frame, init_data_->module->path());
if (!replacement_plugin || !replacement_plugin->initialize(container))
return false;
}
NPObject* message_channel_np_object(instance_->message_channel().np_object());
// The object is expected to be retained before it is returned.
- WebKit::WebBindings::retainObject(message_channel_np_object);
+ blink::WebBindings::retainObject(message_channel_np_object);
return message_channel_np_object;
}
return true;
}
-bool PepperWebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event,
- WebKit::WebCursorInfo& cursor_info) {
+bool PepperWebPluginImpl::handleInputEvent(const blink::WebInputEvent& event,
+ blink::WebCursorInfo& cursor_info) {
if (instance_->FlashIsFullscreenOrPending())
return false;
return instance_->HandleInputEvent(event, &cursor_info);
}
void PepperWebPluginImpl::didReceiveResponse(
- const WebKit::WebURLResponse& response) {
+ const blink::WebURLResponse& response) {
DCHECK(!instance_->document_loader());
instance_->HandleDocumentLoad(response);
}
void PepperWebPluginImpl::didReceiveData(const char* data, int data_length) {
- WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
+ blink::WebURLLoaderClient* document_loader = instance_->document_loader();
if (document_loader)
document_loader->didReceiveData(NULL, data, data_length, 0);
}
void PepperWebPluginImpl::didFinishLoading() {
- WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
+ blink::WebURLLoaderClient* document_loader = instance_->document_loader();
if (document_loader)
- document_loader->didFinishLoading(NULL, 0.0);
+ document_loader->didFinishLoading(NULL, 0.0,
+ blink::WebURLLoaderClient::kUnknownEncodedDataLength);
}
-void PepperWebPluginImpl::didFailLoading(const WebKit::WebURLError& error) {
- WebKit::WebURLLoaderClient* document_loader = instance_->document_loader();
+void PepperWebPluginImpl::didFailLoading(const blink::WebURLError& error) {
+ blink::WebURLLoaderClient* document_loader = instance_->document_loader();
if (document_loader)
document_loader->didFail(NULL, error);
}
void PepperWebPluginImpl::didFinishLoadingFrameRequest(
- const WebKit::WebURL& url,
+ const blink::WebURL& url,
void* notify_data) {
}
void PepperWebPluginImpl::didFailLoadingFrameRequest(
- const WebKit::WebURL& url,
+ const blink::WebURL& url,
void* notify_data,
- const WebKit::WebURLError& error) {
+ const blink::WebURLError& error) {
}
bool PepperWebPluginImpl::hasSelection() const {
instance_->Zoom(content::ZoomLevelToZoomFactor(level), text_only);
}
-bool PepperWebPluginImpl::startFind(const WebKit::WebString& search_text,
+bool PepperWebPluginImpl::startFind(const blink::WebString& search_text,
bool case_sensitive,
int identifier) {
return instance_->StartFind(search_text, case_sensitive, identifier);
}
bool PepperWebPluginImpl::printPage(int page_number,
- WebKit::WebCanvas* canvas) {
+ blink::WebCanvas* canvas) {
return instance_->PrintPage(page_number, canvas);
}