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