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 <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
9 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
10 #include "base/values.h" | 12 #include "base/values.h" |
11 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 13 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/common/extensions/api/terminal_private.h" | 16 #include "chrome/common/extensions/api/terminal_private.h" |
15 #include "chromeos/process_proxy/process_proxy_registry.h" | 17 #include "chromeos/process_proxy/process_proxy_registry.h" |
16 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 60 |
59 scoped_ptr<base::ListValue> args(new base::ListValue()); | 61 scoped_ptr<base::ListValue> args(new base::ListValue()); |
60 args->Append(new base::FundamentalValue(pid)); | 62 args->Append(new base::FundamentalValue(pid)); |
61 args->Append(new base::StringValue(output_type)); | 63 args->Append(new base::StringValue(output_type)); |
62 args->Append(new base::StringValue(output)); | 64 args->Append(new base::StringValue(output)); |
63 | 65 |
64 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); | 66 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); |
65 if (profile && event_router) { | 67 if (profile && event_router) { |
66 scoped_ptr<extensions::Event> event(new extensions::Event( | 68 scoped_ptr<extensions::Event> event(new extensions::Event( |
67 extensions::events::TERMINAL_PRIVATE_ON_PROCESS_OUTPUT, | 69 extensions::events::TERMINAL_PRIVATE_ON_PROCESS_OUTPUT, |
68 terminal_private::OnProcessOutput::kEventName, args.Pass())); | 70 terminal_private::OnProcessOutput::kEventName, std::move(args))); |
69 event_router->DispatchEventToExtension(extension_id, event.Pass()); | 71 event_router->DispatchEventToExtension(extension_id, std::move(event)); |
70 } | 72 } |
71 } | 73 } |
72 | 74 |
73 } // namespace | 75 } // namespace |
74 | 76 |
75 namespace extensions { | 77 namespace extensions { |
76 | 78 |
77 TerminalPrivateFunction::TerminalPrivateFunction() {} | 79 TerminalPrivateFunction::TerminalPrivateFunction() {} |
78 | 80 |
79 TerminalPrivateFunction::~TerminalPrivateFunction() {} | 81 TerminalPrivateFunction::~TerminalPrivateFunction() {} |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 base::Bind(&TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread, | 216 base::Bind(&TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread, |
215 this, success)); | 217 this, success)); |
216 } | 218 } |
217 | 219 |
218 void TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread(bool success) { | 220 void TerminalPrivateOnTerminalResizeFunction::RespondOnUIThread(bool success) { |
219 SetResult(new base::FundamentalValue(success)); | 221 SetResult(new base::FundamentalValue(success)); |
220 SendResponse(true); | 222 SendResponse(true); |
221 } | 223 } |
222 | 224 |
223 } // namespace extensions | 225 } // namespace extensions |
OLD | NEW |