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

Side by Side Diff: chrome/browser/accessibility/accessibility_extension_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
« no previous file with comments | « base/tracked_objects_unittest.cc ('k') | chrome/browser/automation/automation_provider_json.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/accessibility/accessibility_extension_api.h" 5 #include "chrome/browser/accessibility/accessibility_extension_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" 10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // Returns the AccessibilityControlInfo serialized into a JSON string, 25 // Returns the AccessibilityControlInfo serialized into a JSON string,
26 // consisting of an array of a single object of type AccessibilityObject, 26 // consisting of an array of a single object of type AccessibilityObject,
27 // as defined in the accessibility extension api's json schema. 27 // as defined in the accessibility extension api's json schema.
28 std::string ControlInfoToJsonString(const AccessibilityEventInfo* info) { 28 std::string ControlInfoToJsonString(const AccessibilityEventInfo* info) {
29 ListValue args; 29 ListValue args;
30 DictionaryValue* dict = new DictionaryValue(); 30 DictionaryValue* dict = new DictionaryValue();
31 info->SerializeToDict(dict); 31 info->SerializeToDict(dict);
32 args.Append(dict); 32 args.Append(dict);
33 std::string json_args; 33 std::string json_args;
34 base::JSONWriter::Write(&args, false, &json_args); 34 base::JSONWriter::Write(&args, &json_args);
35 return json_args; 35 return json_args;
36 } 36 }
37 37
38 ExtensionAccessibilityEventRouter* 38 ExtensionAccessibilityEventRouter*
39 ExtensionAccessibilityEventRouter::GetInstance() { 39 ExtensionAccessibilityEventRouter::GetInstance() {
40 return Singleton<ExtensionAccessibilityEventRouter>::get(); 40 return Singleton<ExtensionAccessibilityEventRouter>::get();
41 } 41 }
42 42
43 ExtensionAccessibilityEventRouter::ExtensionAccessibilityEventRouter() 43 ExtensionAccessibilityEventRouter::ExtensionAccessibilityEventRouter()
44 : enabled_(false) { 44 : enabled_(false) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 DictionaryValue* alert_value = new DictionaryValue; 219 DictionaryValue* alert_value = new DictionaryValue;
220 const string16 message_text = confirm_infobar_delegate->GetMessageText(); 220 const string16 message_text = confirm_infobar_delegate->GetMessageText();
221 alert_value->SetString(keys::kMessageKey, message_text); 221 alert_value->SetString(keys::kMessageKey, message_text);
222 alerts_value->Append(alert_value); 222 alerts_value->Append(alert_value);
223 } 223 }
224 } 224 }
225 225
226 result_.reset(alerts_value); 226 result_.reset(alerts_value);
227 return true; 227 return true;
228 } 228 }
OLDNEW
« no previous file with comments | « base/tracked_objects_unittest.cc ('k') | chrome/browser/automation/automation_provider_json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698