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/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return; | 51 return; |
52 } | 52 } |
53 | 53 |
54 scoped_ptr<base::ListValue> args(new base::ListValue()); | 54 scoped_ptr<base::ListValue> args(new base::ListValue()); |
55 args->Append(new base::FundamentalValue(pid)); | 55 args->Append(new base::FundamentalValue(pid)); |
56 args->Append(new base::StringValue(output_type)); | 56 args->Append(new base::StringValue(output_type)); |
57 args->Append(new base::StringValue(output)); | 57 args->Append(new base::StringValue(output)); |
58 | 58 |
59 if (profile && | 59 if (profile && |
60 extensions::ExtensionSystem::Get(profile)->event_router()) { | 60 extensions::ExtensionSystem::Get(profile)->event_router()) { |
| 61 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 62 extensions::event_names::kOnTerminalProcessOutput, args.Pass())); |
61 extensions::ExtensionSystem::Get(profile)->event_router()-> | 63 extensions::ExtensionSystem::Get(profile)->event_router()-> |
62 DispatchEventToExtension(extension_id, | 64 DispatchEventToExtension(extension_id, event.Pass()); |
63 extensions::event_names::kOnTerminalProcessOutput, args.Pass(), | |
64 NULL, GURL()); | |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 TerminalPrivateFunction::TerminalPrivateFunction() {} | 70 TerminalPrivateFunction::TerminalPrivateFunction() {} |
71 | 71 |
72 TerminalPrivateFunction::~TerminalPrivateFunction() {} | 72 TerminalPrivateFunction::~TerminalPrivateFunction() {} |
73 | 73 |
74 bool TerminalPrivateFunction::RunImpl() { | 74 bool TerminalPrivateFunction::RunImpl() { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 214 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
215 base::Bind(&OnTerminalResizeFunction::RespondOnUIThread, this, | 215 base::Bind(&OnTerminalResizeFunction::RespondOnUIThread, this, |
216 success)); | 216 success)); |
217 } | 217 } |
218 | 218 |
219 void OnTerminalResizeFunction::RespondOnUIThread(bool success) { | 219 void OnTerminalResizeFunction::RespondOnUIThread(bool success) { |
220 SetResult(new base::FundamentalValue(success)); | 220 SetResult(new base::FundamentalValue(success)); |
221 SendResponse(true); | 221 SendResponse(true); |
222 } | 222 } |
OLD | NEW |