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

Side by Side Diff: chrome/browser/extensions/system/system_api.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/extensions/system/system_api.h" 5 #include "chrome/browser/extensions/system/system_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_event_router.h" 9 #include "chrome/browser/extensions/extension_event_router.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Dispatches an extension event with |args| 51 // Dispatches an extension event with |args|
52 void DispatchEvent(const std::string& event_name, const ListValue& args) { 52 void DispatchEvent(const std::string& event_name, const ListValue& args) {
53 Profile* profile = ProfileManager::GetDefaultProfile(); 53 Profile* profile = ProfileManager::GetDefaultProfile();
54 if (!profile) 54 if (!profile)
55 return; 55 return;
56 ExtensionEventRouter* extension_event_router = 56 ExtensionEventRouter* extension_event_router =
57 profile->GetExtensionEventRouter(); 57 profile->GetExtensionEventRouter();
58 if (!extension_event_router) 58 if (!extension_event_router)
59 return; 59 return;
60 std::string json_args; 60 std::string json_args;
61 base::JSONWriter::Write(&args, false, &json_args); 61 base::JSONWriter::Write(&args, &json_args);
62 extension_event_router->DispatchEventToRenderers( 62 extension_event_router->DispatchEventToRenderers(
63 event_name, json_args, NULL, GURL()); 63 event_name, json_args, NULL, GURL());
64 } 64 }
65 65
66 } // namespace 66 } // namespace
67 67
68 namespace extensions { 68 namespace extensions {
69 69
70 bool GetIncognitoModeAvailabilityFunction::RunImpl() { 70 bool GetIncognitoModeAvailabilityFunction::RunImpl() {
71 PrefService* prefs = profile_->GetPrefs(); 71 PrefService* prefs = profile_->GetPrefs();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 ListValue args; 161 ListValue args;
162 DispatchEvent(kOnScreenUnlocked, args); 162 DispatchEvent(kOnScreenUnlocked, args);
163 } 163 }
164 164
165 void DispatchWokeUpEvent() { 165 void DispatchWokeUpEvent() {
166 ListValue args; 166 ListValue args;
167 DispatchEvent(kOnWokeUp, args); 167 DispatchEvent(kOnWokeUp, args);
168 } 168 }
169 169
170 } // namespace extensions 170 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/settings/settings_sync_util.cc ('k') | chrome/browser/history/history_extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698