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

Side by Side Diff: chrome/browser/extensions/api/terminal/terminal_private_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/api/terminal/terminal_private_api.h" 5 #include "chrome/browser/extensions/api/terminal/terminal_private_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/process_proxy/process_proxy_registry.h" 10 #include "chrome/browser/chromeos/process_proxy/process_proxy_registry.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 pid, output_type, output)); 49 pid, output_type, output));
50 return; 50 return;
51 } 51 }
52 52
53 base::ListValue args; 53 base::ListValue args;
54 args.Append(new base::FundamentalValue(pid)); 54 args.Append(new base::FundamentalValue(pid));
55 args.Append(new base::StringValue(output_type)); 55 args.Append(new base::StringValue(output_type));
56 args.Append(new base::StringValue(output)); 56 args.Append(new base::StringValue(output));
57 57
58 std::string args_json; 58 std::string args_json;
59 base::JSONWriter::Write(&args, false /* pretty_print */, &args_json); 59 base::JSONWriter::Write(&args, &args_json);
60 60
61 if (profile && profile->GetExtensionEventRouter()) { 61 if (profile && profile->GetExtensionEventRouter()) {
62 profile->GetExtensionEventRouter()->DispatchEventToExtension( 62 profile->GetExtensionEventRouter()->DispatchEventToExtension(
63 extension_id, extension_event_names::kOnTerminalProcessOutput, 63 extension_id, extension_event_names::kOnTerminalProcessOutput,
64 args_json, NULL, GURL()); 64 args_json, NULL, GURL());
65 } 65 }
66 } 66 }
67 67
68 } // namespace 68 } // namespace
69 69
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 212 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
213 base::Bind(&OnTerminalResizeFunction::RespondOnUIThread, this, 213 base::Bind(&OnTerminalResizeFunction::RespondOnUIThread, this,
214 success)); 214 success));
215 } 215 }
216 216
217 void OnTerminalResizeFunction::RespondOnUIThread(bool success) { 217 void OnTerminalResizeFunction::RespondOnUIThread(bool success) {
218 result_.reset(new base::FundamentalValue(success)); 218 result_.reset(new base::FundamentalValue(success));
219 SendResponse(true); 219 SendResponse(true);
220 } 220 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/proxy/proxy_api.cc ('k') | chrome/browser/extensions/api/webrequest/webrequest_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698