| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 | 760 |
| 761 void BrowserPlugin::TriggerEvent(const std::string& event_name, | 761 void BrowserPlugin::TriggerEvent(const std::string& event_name, |
| 762 std::map<std::string, base::Value*>* props) { | 762 std::map<std::string, base::Value*>* props) { |
| 763 if (!container()) | 763 if (!container()) |
| 764 return; | 764 return; |
| 765 | 765 |
| 766 WebKit::WebFrame* frame = container()->element().document().frame(); | 766 WebKit::WebFrame* frame = container()->element().document().frame(); |
| 767 if (!frame) | 767 if (!frame) |
| 768 return; | 768 return; |
| 769 | 769 |
| 770 v8::HandleScope handle_scope; | 770 v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
| 771 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); | 771 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); |
| 772 v8::Context::Scope context_scope(context); | 772 v8::Context::Scope context_scope(context); |
| 773 | 773 |
| 774 std::string json_string; | 774 std::string json_string; |
| 775 if (props) { | 775 if (props) { |
| 776 base::DictionaryValue dict; | 776 base::DictionaryValue dict; |
| 777 for (std::map<std::string, base::Value*>::iterator iter = props->begin(), | 777 for (std::map<std::string, base::Value*>::iterator iter = props->begin(), |
| 778 end = props->end(); iter != end; ++iter) { | 778 end = props->end(); iter != end; ++iter) { |
| 779 dict.Set(iter->first, iter->second); | 779 dict.Set(iter->first, iter->second); |
| 780 } | 780 } |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 const WebKit::WebMouseEvent& event) { | 1279 const WebKit::WebMouseEvent& event) { |
| 1280 browser_plugin_manager()->Send( | 1280 browser_plugin_manager()->Send( |
| 1281 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 1281 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
| 1282 guest_instance_id_, | 1282 guest_instance_id_, |
| 1283 plugin_rect_, | 1283 plugin_rect_, |
| 1284 &event)); | 1284 &event)); |
| 1285 return true; | 1285 return true; |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 } // namespace content | 1288 } // namespace content |
| OLD | NEW |