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