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

Unified Diff: chrome/browser/extensions/extension_browser_event_router.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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/browser/extensions/extension_browser_event_router.cc
diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc
index 473ca6779ef80761ac7db3a914cd16711ff84454..ac348df83cf1b04ac34ac10be410a18cd3912467 100644
--- a/chrome/browser/extensions/extension_browser_event_router.cc
+++ b/chrome/browser/extensions/extension_browser_event_router.cc
@@ -178,7 +178,7 @@ void ExtensionBrowserEventRouter::OnBrowserWindowReady(const Browser* browser) {
args.Append(window_dictionary);
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEvent(browser->profile(), events::kOnWindowCreated, json_args);
}
@@ -234,7 +234,7 @@ void ExtensionBrowserEventRouter::OnBrowserSetLastActive(
ListValue real_args;
real_args.Append(Value::CreateIntegerValue(window_id));
std::string real_json_args;
- base::JSONWriter::Write(&real_args, false, &real_json_args);
+ base::JSONWriter::Write(&real_args, &real_json_args);
// When switching between windows in the default and incognitoi profiles,
// dispatch WINDOW_ID_NONE to extensions whose profile lost focus that
@@ -246,7 +246,7 @@ void ExtensionBrowserEventRouter::OnBrowserSetLastActive(
ListValue none_args;
none_args.Append(
Value::CreateIntegerValue(extension_misc::kUnknownWindowId));
- base::JSONWriter::Write(&none_args, false, &none_json_args);
+ base::JSONWriter::Write(&none_args, &none_json_args);
}
DispatchEventsAcrossIncognito((focused_profile_ ? focused_profile_ :
@@ -288,7 +288,7 @@ void ExtensionBrowserEventRouter::TabInsertedAt(TabContentsWrapper* contents,
args.Append(object_args);
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEvent(contents->profile(), events::kOnTabAttached, json_args);
}
@@ -312,7 +312,7 @@ void ExtensionBrowserEventRouter::TabDetachedAt(TabContentsWrapper* contents,
args.Append(object_args);
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEvent(contents->profile(), events::kOnTabDetached, json_args);
}
@@ -331,7 +331,7 @@ void ExtensionBrowserEventRouter::TabClosingAt(TabStripModel* tab_strip_model,
args.Append(object_args);
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEvent(contents->profile(), events::kOnTabRemoved, json_args);
@@ -358,13 +358,13 @@ void ExtensionBrowserEventRouter::ActiveTabChanged(
// The onActivated event replaced onActiveChanged and onSelectionChanged. The
// deprecated events take two arguments: tabId, {windowId}.
std::string old_json_args;
- base::JSONWriter::Write(&args, false, &old_json_args);
+ base::JSONWriter::Write(&args, &old_json_args);
// The onActivated event takes one argument: {windowId, tabId}.
std::string new_json_args;
args.Remove(0, NULL);
object_args->Set(tab_keys::kTabIdKey, Value::CreateIntegerValue(tab_id));
- base::JSONWriter::Write(&args, false, &new_json_args);
+ base::JSONWriter::Write(&args, &new_json_args);
Profile* profile = new_contents->profile();
DispatchEvent(profile, events::kOnTabSelectionChanged, old_json_args);
@@ -398,7 +398,7 @@ void ExtensionBrowserEventRouter::TabSelectionChanged(
args.Append(select_info);
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
// The onHighlighted event replaced onHighlightChanged.
Profile* profile = tab_strip_model->profile();
@@ -423,7 +423,7 @@ void ExtensionBrowserEventRouter::TabMoved(TabContentsWrapper* contents,
args.Append(object_args);
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEvent(contents->profile(), events::kOnTabMoved, json_args);
}
@@ -491,7 +491,7 @@ void ExtensionBrowserEventRouter::DispatchEventWithTab(
args.Append(ExtensionTabUtil::CreateTabValueActive(
web_contents, active));
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
if (!extension_id.empty()) {
DispatchEventToExtension(profile, extension_id, event_name, json_args);
} else {
@@ -508,7 +508,7 @@ void ExtensionBrowserEventRouter::DispatchSimpleBrowserEvent(
args.Append(Value::CreateIntegerValue(window_id));
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEvent(profile, event_name, json_args);
}
@@ -532,7 +532,7 @@ void ExtensionBrowserEventRouter::DispatchTabUpdatedEvent(
args.Append(ExtensionTabUtil::CreateTabValue(contents));
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
DispatchEvent(profile, events::kOnTabUpdated, json_args);
@@ -623,7 +623,7 @@ void ExtensionBrowserEventRouter::DispatchOldPageActionEvent(
args.Append(data);
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEventToExtension(profile, extension_id, "pageActions", json_args);
}
@@ -663,7 +663,7 @@ void ExtensionBrowserEventRouter::CommandExecuted(
ListValue args;
args.Append(Value::CreateStringValue(command));
std::string json_args;
- base::JSONWriter::Write(&args, false, &json_args);
+ base::JSONWriter::Write(&args, &json_args);
DispatchEventToExtension(profile,
extension_id,
« no previous file with comments | « chrome/browser/extensions/app_notification_storage.cc ('k') | chrome/browser/extensions/extension_cookies_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698