OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |