| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "extensions/browser/extension_function.h" | 10 #include "extensions/browser/extension_function.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 using ProcessOutputCallback = | 29 using ProcessOutputCallback = |
| 30 base::Callback<void(int terminal_id, | 30 base::Callback<void(int terminal_id, |
| 31 const std::string& output_type, | 31 const std::string& output_type, |
| 32 const std::string& output)>; | 32 const std::string& output)>; |
| 33 using OpenProcessCallback = base::Callback<void(int terminal_id)>; | 33 using OpenProcessCallback = base::Callback<void(int terminal_id)>; |
| 34 | 34 |
| 35 void OpenOnFileThread(const ProcessOutputCallback& output_callback, | 35 void OpenOnFileThread(const ProcessOutputCallback& output_callback, |
| 36 const OpenProcessCallback& callback); | 36 const OpenProcessCallback& callback); |
| 37 void RespondOnUIThread(int terminal_id); | 37 void RespondOnUIThread(int terminal_id); |
| 38 | 38 |
| 39 const char* command_; | 39 std::string command_; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Send input to the terminal process specified by the terminal ID, which is set | 42 // Send input to the terminal process specified by the terminal ID, which is set |
| 43 // as an argument. | 43 // as an argument. |
| 44 class TerminalPrivateSendInputFunction : public UIThreadExtensionFunction { | 44 class TerminalPrivateSendInputFunction : public UIThreadExtensionFunction { |
| 45 public: | 45 public: |
| 46 DECLARE_EXTENSION_FUNCTION("terminalPrivate.sendInput", | 46 DECLARE_EXTENSION_FUNCTION("terminalPrivate.sendInput", |
| 47 TERMINALPRIVATE_SENDINPUT) | 47 TERMINALPRIVATE_SENDINPUT) |
| 48 | 48 |
| 49 protected: | 49 protected: |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 ExtensionFunction::ResponseAction Run() override; | 101 ExtensionFunction::ResponseAction Run() override; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 void AckOutputOnFileThread(int terminal_id); | 104 void AckOutputOnFileThread(int terminal_id); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace extensions | 107 } // namespace extensions |
| 108 | 108 |
| 109 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ | 109 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ |
| OLD | NEW |