| 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_APP_WINDOW_APP_WINDOW_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_APP_WINDOW_APP_WINDOW_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_APP_WINDOW_APP_WINDOW_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_APP_WINDOW_APP_WINDOW_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
| 9 | 9 |
| 10 class ShellWindow; | |
| 11 | |
| 12 namespace extensions { | 10 namespace extensions { |
| 13 | 11 |
| 14 class AppWindowExtensionFunction : public SyncExtensionFunction { | |
| 15 protected: | |
| 16 virtual ~AppWindowExtensionFunction() {} | |
| 17 | |
| 18 // Invoked with the current shell window. | |
| 19 virtual bool RunWithWindow(ShellWindow* window) = 0; | |
| 20 | |
| 21 private: | |
| 22 virtual bool RunImpl() OVERRIDE; | |
| 23 }; | |
| 24 | |
| 25 class AppWindowCreateFunction : public SyncExtensionFunction { | 12 class AppWindowCreateFunction : public SyncExtensionFunction { |
| 26 public: | 13 public: |
| 27 DECLARE_EXTENSION_FUNCTION_NAME("app.window.create"); | 14 DECLARE_EXTENSION_FUNCTION_NAME("app.window.create"); |
| 28 | 15 |
| 29 protected: | 16 protected: |
| 30 virtual ~AppWindowCreateFunction() {} | 17 virtual ~AppWindowCreateFunction() {} |
| 31 virtual bool RunImpl() OVERRIDE; | 18 virtual bool RunImpl() OVERRIDE; |
| 32 }; | 19 }; |
| 33 | 20 |
| 34 class AppWindowFocusFunction : public AppWindowExtensionFunction { | |
| 35 public: | |
| 36 DECLARE_EXTENSION_FUNCTION_NAME("app.window.focus"); | |
| 37 | |
| 38 protected: | |
| 39 virtual ~AppWindowFocusFunction() {} | |
| 40 virtual bool RunWithWindow(ShellWindow* window) OVERRIDE; | |
| 41 }; | |
| 42 | |
| 43 class AppWindowMaximizeFunction : public AppWindowExtensionFunction { | |
| 44 public: | |
| 45 DECLARE_EXTENSION_FUNCTION_NAME("app.window.maximize"); | |
| 46 | |
| 47 protected: | |
| 48 virtual ~AppWindowMaximizeFunction() {} | |
| 49 virtual bool RunWithWindow(ShellWindow* window) OVERRIDE; | |
| 50 }; | |
| 51 | |
| 52 class AppWindowMinimizeFunction : public AppWindowExtensionFunction { | |
| 53 public: | |
| 54 DECLARE_EXTENSION_FUNCTION_NAME("app.window.minimize"); | |
| 55 | |
| 56 protected: | |
| 57 virtual ~AppWindowMinimizeFunction() {} | |
| 58 virtual bool RunWithWindow(ShellWindow* window) OVERRIDE; | |
| 59 }; | |
| 60 | |
| 61 class AppWindowRestoreFunction : public AppWindowExtensionFunction { | |
| 62 public: | |
| 63 DECLARE_EXTENSION_FUNCTION_NAME("app.window.restore"); | |
| 64 | |
| 65 protected: | |
| 66 virtual ~AppWindowRestoreFunction() {} | |
| 67 virtual bool RunWithWindow(ShellWindow* window) OVERRIDE; | |
| 68 }; | |
| 69 | |
| 70 } // namespace extensions | 21 } // namespace extensions |
| 71 | 22 |
| 72 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_WINDOW_APP_WINDOW_API_H_ | 23 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_WINDOW_APP_WINDOW_API_H_ |
| OLD | NEW |