Index: chrome/browser/extensions/extension_devtools_bridge.cc |
diff --git a/chrome/browser/extensions/extension_devtools_bridge.cc b/chrome/browser/extensions/extension_devtools_bridge.cc |
index bdd4f911431aec2348436bab5384d1359b8ba2b2..0d215888ba2667582768b7a1049a2850de34558b 100644 |
--- a/chrome/browser/extensions/extension_devtools_bridge.cc |
+++ b/chrome/browser/extensions/extension_devtools_bridge.cc |
@@ -4,10 +4,11 @@ |
#include "chrome/browser/extensions/extension_devtools_bridge.h" |
+#include "base/json/json_reader.h" |
#include "base/json/json_writer.h" |
#include "base/message_loop.h" |
-#include "base/string_util.h" |
#include "base/stringprintf.h" |
+#include "base/string_util.h" |
#include "base/values.h" |
#include "chrome/browser/extensions/extension_devtools_events.h" |
#include "chrome/browser/extensions/extension_devtools_manager.h" |
@@ -105,9 +106,10 @@ void ExtensionDevToolsBridge::InspectedContentsClosing() { |
// TODO(knorton): Remove this event in favor of the standard tabs.onRemoved |
// event in extensions. |
- std::string json("[{}]"); |
+ base::ListValue* arguments = new base::ListValue(); |
+ arguments->Set(0, new base::DictionaryValue()); |
profile_->GetExtensionEventRouter()->DispatchEventToRenderers( |
- on_tab_close_event_name_, json, profile_, GURL()); |
+ on_tab_close_event_name_, arguments, profile_, GURL()); |
// This may result in this object being destroyed. |
extension_devtools_manager_->BridgeClosingForTab(tab_id_); |
@@ -117,9 +119,11 @@ void ExtensionDevToolsBridge::DispatchOnInspectorFrontend( |
const std::string& data) { |
DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); |
- std::string json = base::StringPrintf("[%s]", data.c_str()); |
+ base::ListValue* arguments = new base::ListValue(); |
+ arguments->Append(base::JSONReader::Read(data)); |
+ |
profile_->GetExtensionEventRouter()->DispatchEventToRenderers( |
- on_page_event_name_, json, profile_, GURL()); |
+ on_page_event_name_, arguments, profile_, GURL()); |
} |
void ExtensionDevToolsBridge::ContentsReplaced(WebContents* new_contents) { |