| 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/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 scoped_ptr<base::ListValue> args(new base::ListValue()); | 59 scoped_ptr<base::ListValue> args(new base::ListValue()); |
| 60 args->Append(new base::FundamentalValue(pid)); | 60 args->Append(new base::FundamentalValue(pid)); |
| 61 args->Append(new base::StringValue(output_type)); | 61 args->Append(new base::StringValue(output_type)); |
| 62 args->Append(new base::StringValue(output)); | 62 args->Append(new base::StringValue(output)); |
| 63 | 63 |
| 64 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); | 64 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); |
| 65 if (profile && event_router) { | 65 if (profile && event_router) { |
| 66 scoped_ptr<extensions::Event> event(new extensions::Event( | 66 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 67 extensions::events::UNKNOWN, |
| 67 terminal_private::OnProcessOutput::kEventName, args.Pass())); | 68 terminal_private::OnProcessOutput::kEventName, args.Pass())); |
| 68 event_router->DispatchEventToExtension(extension_id, event.Pass()); | 69 event_router->DispatchEventToExtension(extension_id, event.Pass()); |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 | 72 |
| 72 } // namespace | 73 } // namespace |
| 73 | 74 |
| 74 namespace extensions { | 75 namespace extensions { |
| 75 | 76 |
| 76 TerminalPrivateFunction::TerminalPrivateFunction() {} | 77 TerminalPrivateFunction::TerminalPrivateFunction() {} |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 base::Bind(&TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread, | 214 base::Bind(&TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread, |
| 214 this, success)); | 215 this, success)); |
| 215 } | 216 } |
| 216 | 217 |
| 217 void TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread(bool success) { | 218 void TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread(bool success) { |
| 218 SetResult(new base::FundamentalValue(success)); | 219 SetResult(new base::FundamentalValue(success)); |
| 219 SendResponse(true); | 220 SendResponse(true); |
| 220 } | 221 } |
| 221 | 222 |
| 222 } // namespace extensions | 223 } // namespace extensions |
| OLD | NEW |