Index: content/renderer/browser_plugin/browser_plugin_impl.cc |
diff --git a/content/renderer/browser_plugin/browser_plugin_impl.cc b/content/renderer/browser_plugin/browser_plugin_impl.cc |
index 132aaba069c4da212fa2ef518b35357e0053f244..11cb2f69f34160d58ce16c9c58cd7dd033dbdd1c 100644 |
--- a/content/renderer/browser_plugin/browser_plugin_impl.cc |
+++ b/content/renderer/browser_plugin/browser_plugin_impl.cc |
@@ -660,43 +660,6 @@ float BrowserPluginImpl::GetDeviceScaleFactor() const { |
return render_view_->GetWebView()->deviceScaleFactor(); |
} |
-void BrowserPluginImpl::TriggerEvent( |
- const std::string& event_name, |
- std::map<std::string, base::Value*>* props) { |
- if (!container() || !container()->element().document().frame()) |
- return; |
- v8::HandleScope handle_scope; |
- std::string json_string; |
- if (props) { |
- base::DictionaryValue dict; |
- for (std::map<std::string, base::Value*>::iterator iter = props->begin(), |
- end = props->end(); iter != end; ++iter) { |
- dict.Set(iter->first, iter->second); |
- } |
- |
- JSONStringValueSerializer serializer(&json_string); |
- if (!serializer.Serialize(dict)) |
- return; |
- } |
- |
- WebKit::WebFrame* frame = container()->element().document().frame(); |
- WebKit::WebDOMEvent dom_event = frame->document().createEvent("CustomEvent"); |
- WebKit::WebDOMCustomEvent event = dom_event.to<WebKit::WebDOMCustomEvent>(); |
- |
- // The events triggered directly from the plugin <object> are internal events |
- // whose implementation details can (and likely will) change over time. The |
- // wrapper/shim (e.g. <webview> tag) should receive these events, and expose a |
- // more appropriate (and stable) event to the consumers as part of the API. |
- std::string internal_name = base::StringPrintf("-internal-%s", |
- event_name.c_str()); |
- event.initCustomEvent( |
- WebKit::WebString::fromUTF8(internal_name.c_str()), |
- false, false, |
- WebKit::WebSerializedScriptValue::serialize( |
- v8::String::New(json_string.c_str(), json_string.size()))); |
- container()->element().dispatchEvent(event); |
-} |
- |
void BrowserPluginImpl::Back() { |
if (!navigate_src_sent_) |
return; |
@@ -875,6 +838,51 @@ void BrowserPluginImpl::RequestMessage(uint32 message_id) { |
browser_plugin_manager()->RequestMessage(message_id); |
} |
+RenderView* BrowserPluginImpl::GetRenderView() const { |
+ return render_view_; |
+} |
+ |
+WebKit::WebPluginContainer* BrowserPluginImpl::GetContainer() const { |
+ return container(); |
+} |
+ |
+void BrowserPluginImpl::TriggerEvent( |
+ const std::string& event_name, |
+ std::map<std::string, base::Value*>* props) { |
+ if (!container() || !container()->element().document().frame()) |
+ return; |
+ v8::HandleScope handle_scope; |
+ std::string json_string; |
+ if (props) { |
+ base::DictionaryValue dict; |
+ for (std::map<std::string, base::Value*>::iterator iter = props->begin(), |
+ end = props->end(); iter != end; ++iter) { |
+ dict.Set(iter->first, iter->second); |
+ } |
+ |
+ JSONStringValueSerializer serializer(&json_string); |
+ if (!serializer.Serialize(dict)) |
+ return; |
+ } |
+ |
+ WebKit::WebFrame* frame = container()->element().document().frame(); |
+ WebKit::WebDOMEvent dom_event = frame->document().createEvent("CustomEvent"); |
+ WebKit::WebDOMCustomEvent event = dom_event.to<WebKit::WebDOMCustomEvent>(); |
+ |
+ // The events triggered directly from the plugin <object> are internal events |
+ // whose implementation details can (and likely will) change over time. The |
+ // wrapper/shim (e.g. <webview> tag) should receive these events, and expose a |
+ // more appropriate (and stable) event to the consumers as part of the API. |
+ std::string internal_name = base::StringPrintf("-internal-%s", |
+ event_name.c_str()); |
+ event.initCustomEvent( |
+ WebKit::WebString::fromUTF8(internal_name.c_str()), |
+ false, false, |
+ WebKit::WebSerializedScriptValue::serialize( |
+ v8::String::New(json_string.c_str(), json_string.size()))); |
+ container()->element().dispatchEvent(event); |
+} |
+ |
gfx::Point BrowserPluginImpl::ToLocalCoordinates( |
const gfx::Point& point) const { |
if (container_) |