Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: chrome/browser/extensions/api/terminal/terminal_private_api.h

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/extensions/chrome_extension_function.h" 10 #include "chrome/browser/extensions/chrome_extension_function.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 // Base class for all terminalPrivate function classes. Main purpose is to run 13 // Base class for all terminalPrivate function classes. Main purpose is to run
14 // permission check before calling actual function implementation. 14 // permission check before calling actual function implementation.
15 class TerminalPrivateFunction : public ChromeAsyncExtensionFunction { 15 class TerminalPrivateFunction : public ChromeAsyncExtensionFunction {
16 public: 16 public:
17 TerminalPrivateFunction(); 17 TerminalPrivateFunction();
18 18
19 protected: 19 protected:
20 virtual ~TerminalPrivateFunction(); 20 virtual ~TerminalPrivateFunction();
21 21
22 // ExtensionFunction: 22 // ExtensionFunction:
23 virtual bool RunImpl() OVERRIDE; 23 virtual bool RunAsync() OVERRIDE;
24 24
25 // Override with actual extension function implementation. 25 // Override with actual extension function implementation.
26 virtual bool RunTerminalFunction() = 0; 26 virtual bool RunTerminalFunction() = 0;
27 }; 27 };
28 28
29 // Opens new terminal process. Returns the new process id. 29 // Opens new terminal process. Returns the new process id.
30 class TerminalPrivateOpenTerminalProcessFunction 30 class TerminalPrivateOpenTerminalProcessFunction
31 : public TerminalPrivateFunction { 31 : public TerminalPrivateFunction {
32 public: 32 public:
33 DECLARE_EXTENSION_FUNCTION("terminalPrivate.openTerminalProcess", 33 DECLARE_EXTENSION_FUNCTION("terminalPrivate.openTerminalProcess",
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 virtual bool RunTerminalFunction() OVERRIDE; 94 virtual bool RunTerminalFunction() OVERRIDE;
95 95
96 private: 96 private:
97 void OnResizeOnFileThread(pid_t pid, int width, int height); 97 void OnResizeOnFileThread(pid_t pid, int width, int height);
98 void RespondOnUIThread(bool success); 98 void RespondOnUIThread(bool success);
99 }; 99 };
100 100
101 } // namespace extensions 101 } // namespace extensions
102 102
103 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_ 103 #endif // CHROME_BROWSER_EXTENSIONS_API_TERMINAL_TERMINAL_PRIVATE_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/windows_util.cc ('k') | chrome/browser/extensions/api/terminal/terminal_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698