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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 const char* command_; | 47 const char* command_; |
48 }; | 48 }; |
49 | 49 |
50 // Send input to the terminal process specified by the pid sent as an argument. | 50 // Send input to the terminal process specified by the pid sent as an argument. |
51 class SendInputToTerminalProcessFunction : public TerminalPrivateFunction { | 51 class SendInputToTerminalProcessFunction : public TerminalPrivateFunction { |
52 public: | 52 public: |
53 DECLARE_EXTENSION_FUNCTION_NAME("terminalPrivate.sendInput") | 53 DECLARE_EXTENSION_FUNCTION_NAME("terminalPrivate.sendInput") |
54 | 54 |
55 protected: | 55 protected: |
| 56 virtual ~SendInputToTerminalProcessFunction(); |
| 57 |
56 // TerminalPrivateFunction: | 58 // TerminalPrivateFunction: |
57 virtual bool RunTerminalFunction() OVERRIDE; | 59 virtual bool RunTerminalFunction() OVERRIDE; |
58 | 60 |
59 private: | 61 private: |
60 void SendInputOnFileThread(pid_t pid, const std::string& input); | 62 void SendInputOnFileThread(pid_t pid, const std::string& input); |
61 void RespondOnUIThread(bool success); | 63 void RespondOnUIThread(bool success); |
62 }; | 64 }; |
63 | 65 |
64 // Closes terminal process with given pid. | 66 // Closes terminal process with given pid. |
65 class CloseTerminalProcessFunction : public TerminalPrivateFunction { | 67 class CloseTerminalProcessFunction : public TerminalPrivateFunction { |
66 public: | 68 public: |
67 DECLARE_EXTENSION_FUNCTION_NAME("terminalPrivate.closeTerminalProcess") | 69 DECLARE_EXTENSION_FUNCTION_NAME("terminalPrivate.closeTerminalProcess") |
68 | 70 |
69 protected: | 71 protected: |
| 72 virtual ~CloseTerminalProcessFunction(); |
| 73 |
70 virtual bool RunTerminalFunction() OVERRIDE; | 74 virtual bool RunTerminalFunction() OVERRIDE; |
71 | 75 |
72 private: | 76 private: |
73 void CloseOnFileThread(pid_t pid); | 77 void CloseOnFileThread(pid_t pid); |
74 void RespondOnUIThread(bool success); | 78 void RespondOnUIThread(bool success); |
75 }; | 79 }; |
76 | 80 |
77 // Called by extension when terminal size changes. | 81 // Called by extension when terminal size changes. |
78 class OnTerminalResizeFunction : public TerminalPrivateFunction { | 82 class OnTerminalResizeFunction : public TerminalPrivateFunction { |
79 public: | 83 public: |
80 DECLARE_EXTENSION_FUNCTION_NAME("terminalPrivate.onTerminalResize") | 84 DECLARE_EXTENSION_FUNCTION_NAME("terminalPrivate.onTerminalResize") |
81 | 85 |
82 protected: | 86 protected: |
| 87 virtual ~OnTerminalResizeFunction(); |
| 88 |
83 virtual bool RunTerminalFunction() OVERRIDE; | 89 virtual bool RunTerminalFunction() OVERRIDE; |
84 | 90 |
85 private: | 91 private: |
86 void OnResizeOnFileThread(pid_t pid, int width, int height); | 92 void OnResizeOnFileThread(pid_t pid, int width, int height); |
87 void RespondOnUIThread(bool success); | 93 void RespondOnUIThread(bool success); |
88 }; | 94 }; |
89 | 95 |
90 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ | 96 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ |
OLD | NEW |