| 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_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WI
NDOW_INTERNAL_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WI
NDOW_INTERNAL_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WI
NDOW_INTERNAL_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WI
NDOW_INTERNAL_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/chrome_extension_function.h" | 8 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 9 | 9 |
| 10 namespace apps { | 10 namespace extensions { |
| 11 |
| 11 class AppWindow; | 12 class AppWindow; |
| 12 } | |
| 13 | |
| 14 namespace extensions { | |
| 15 | 13 |
| 16 class AppCurrentWindowInternalExtensionFunction | 14 class AppCurrentWindowInternalExtensionFunction |
| 17 : public ChromeSyncExtensionFunction { | 15 : public ChromeSyncExtensionFunction { |
| 18 protected: | 16 protected: |
| 19 virtual ~AppCurrentWindowInternalExtensionFunction() {} | 17 virtual ~AppCurrentWindowInternalExtensionFunction() {} |
| 20 | 18 |
| 21 // Invoked with the current app window. | 19 // Invoked with the current app window. |
| 22 virtual bool RunWithWindow(apps::AppWindow* window) = 0; | 20 virtual bool RunWithWindow(AppWindow* window) = 0; |
| 23 | 21 |
| 24 private: | 22 private: |
| 25 virtual bool RunSync() OVERRIDE; | 23 virtual bool RunSync() OVERRIDE; |
| 26 }; | 24 }; |
| 27 | 25 |
| 28 class AppCurrentWindowInternalFocusFunction | 26 class AppCurrentWindowInternalFocusFunction |
| 29 : public AppCurrentWindowInternalExtensionFunction { | 27 : public AppCurrentWindowInternalExtensionFunction { |
| 30 public: | 28 public: |
| 31 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.focus", | 29 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.focus", |
| 32 APP_CURRENTWINDOWINTERNAL_FOCUS) | 30 APP_CURRENTWINDOWINTERNAL_FOCUS) |
| 33 | 31 |
| 34 protected: | 32 protected: |
| 35 virtual ~AppCurrentWindowInternalFocusFunction() {} | 33 virtual ~AppCurrentWindowInternalFocusFunction() {} |
| 36 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 34 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 37 }; | 35 }; |
| 38 | 36 |
| 39 class AppCurrentWindowInternalFullscreenFunction | 37 class AppCurrentWindowInternalFullscreenFunction |
| 40 : public AppCurrentWindowInternalExtensionFunction { | 38 : public AppCurrentWindowInternalExtensionFunction { |
| 41 public: | 39 public: |
| 42 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.fullscreen", | 40 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.fullscreen", |
| 43 APP_CURRENTWINDOWINTERNAL_FULLSCREEN) | 41 APP_CURRENTWINDOWINTERNAL_FULLSCREEN) |
| 44 | 42 |
| 45 protected: | 43 protected: |
| 46 virtual ~AppCurrentWindowInternalFullscreenFunction() {} | 44 virtual ~AppCurrentWindowInternalFullscreenFunction() {} |
| 47 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 45 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 class AppCurrentWindowInternalMaximizeFunction | 48 class AppCurrentWindowInternalMaximizeFunction |
| 51 : public AppCurrentWindowInternalExtensionFunction { | 49 : public AppCurrentWindowInternalExtensionFunction { |
| 52 public: | 50 public: |
| 53 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.maximize", | 51 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.maximize", |
| 54 APP_CURRENTWINDOWINTERNAL_MAXIMIZE) | 52 APP_CURRENTWINDOWINTERNAL_MAXIMIZE) |
| 55 | 53 |
| 56 protected: | 54 protected: |
| 57 virtual ~AppCurrentWindowInternalMaximizeFunction() {} | 55 virtual ~AppCurrentWindowInternalMaximizeFunction() {} |
| 58 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 56 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 class AppCurrentWindowInternalMinimizeFunction | 59 class AppCurrentWindowInternalMinimizeFunction |
| 62 : public AppCurrentWindowInternalExtensionFunction { | 60 : public AppCurrentWindowInternalExtensionFunction { |
| 63 public: | 61 public: |
| 64 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.minimize", | 62 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.minimize", |
| 65 APP_CURRENTWINDOWINTERNAL_MINIMIZE) | 63 APP_CURRENTWINDOWINTERNAL_MINIMIZE) |
| 66 | 64 |
| 67 protected: | 65 protected: |
| 68 virtual ~AppCurrentWindowInternalMinimizeFunction() {} | 66 virtual ~AppCurrentWindowInternalMinimizeFunction() {} |
| 69 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 67 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 class AppCurrentWindowInternalRestoreFunction | 70 class AppCurrentWindowInternalRestoreFunction |
| 73 : public AppCurrentWindowInternalExtensionFunction { | 71 : public AppCurrentWindowInternalExtensionFunction { |
| 74 public: | 72 public: |
| 75 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.restore", | 73 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.restore", |
| 76 APP_CURRENTWINDOWINTERNAL_RESTORE) | 74 APP_CURRENTWINDOWINTERNAL_RESTORE) |
| 77 | 75 |
| 78 protected: | 76 protected: |
| 79 virtual ~AppCurrentWindowInternalRestoreFunction() {} | 77 virtual ~AppCurrentWindowInternalRestoreFunction() {} |
| 80 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 78 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 81 }; | 79 }; |
| 82 | 80 |
| 83 class AppCurrentWindowInternalDrawAttentionFunction | 81 class AppCurrentWindowInternalDrawAttentionFunction |
| 84 : public AppCurrentWindowInternalExtensionFunction { | 82 : public AppCurrentWindowInternalExtensionFunction { |
| 85 public: | 83 public: |
| 86 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.drawAttention", | 84 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.drawAttention", |
| 87 APP_CURRENTWINDOWINTERNAL_DRAWATTENTION) | 85 APP_CURRENTWINDOWINTERNAL_DRAWATTENTION) |
| 88 | 86 |
| 89 protected: | 87 protected: |
| 90 virtual ~AppCurrentWindowInternalDrawAttentionFunction() {} | 88 virtual ~AppCurrentWindowInternalDrawAttentionFunction() {} |
| 91 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 89 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 92 }; | 90 }; |
| 93 | 91 |
| 94 class AppCurrentWindowInternalClearAttentionFunction | 92 class AppCurrentWindowInternalClearAttentionFunction |
| 95 : public AppCurrentWindowInternalExtensionFunction { | 93 : public AppCurrentWindowInternalExtensionFunction { |
| 96 public: | 94 public: |
| 97 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.clearAttention", | 95 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.clearAttention", |
| 98 APP_CURRENTWINDOWINTERNAL_CLEARATTENTION) | 96 APP_CURRENTWINDOWINTERNAL_CLEARATTENTION) |
| 99 | 97 |
| 100 protected: | 98 protected: |
| 101 virtual ~AppCurrentWindowInternalClearAttentionFunction() {} | 99 virtual ~AppCurrentWindowInternalClearAttentionFunction() {} |
| 102 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 100 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 103 }; | 101 }; |
| 104 | 102 |
| 105 class AppCurrentWindowInternalShowFunction | 103 class AppCurrentWindowInternalShowFunction |
| 106 : public AppCurrentWindowInternalExtensionFunction { | 104 : public AppCurrentWindowInternalExtensionFunction { |
| 107 public: | 105 public: |
| 108 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.show", | 106 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.show", |
| 109 APP_CURRENTWINDOWINTERNAL_SHOW) | 107 APP_CURRENTWINDOWINTERNAL_SHOW) |
| 110 | 108 |
| 111 protected: | 109 protected: |
| 112 virtual ~AppCurrentWindowInternalShowFunction() {} | 110 virtual ~AppCurrentWindowInternalShowFunction() {} |
| 113 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 111 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 114 }; | 112 }; |
| 115 | 113 |
| 116 class AppCurrentWindowInternalHideFunction | 114 class AppCurrentWindowInternalHideFunction |
| 117 : public AppCurrentWindowInternalExtensionFunction { | 115 : public AppCurrentWindowInternalExtensionFunction { |
| 118 public: | 116 public: |
| 119 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.hide", | 117 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.hide", |
| 120 APP_CURRENTWINDOWINTERNAL_HIDE) | 118 APP_CURRENTWINDOWINTERNAL_HIDE) |
| 121 | 119 |
| 122 protected: | 120 protected: |
| 123 virtual ~AppCurrentWindowInternalHideFunction() {} | 121 virtual ~AppCurrentWindowInternalHideFunction() {} |
| 124 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 122 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 125 }; | 123 }; |
| 126 | 124 |
| 127 class AppCurrentWindowInternalSetBoundsFunction | 125 class AppCurrentWindowInternalSetBoundsFunction |
| 128 : public AppCurrentWindowInternalExtensionFunction { | 126 : public AppCurrentWindowInternalExtensionFunction { |
| 129 public: | 127 public: |
| 130 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setBounds", | 128 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setBounds", |
| 131 APP_CURRENTWINDOWINTERNAL_SETBOUNDS) | 129 APP_CURRENTWINDOWINTERNAL_SETBOUNDS) |
| 132 protected: | 130 protected: |
| 133 virtual ~AppCurrentWindowInternalSetBoundsFunction() {} | 131 virtual ~AppCurrentWindowInternalSetBoundsFunction() {} |
| 134 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 132 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 135 }; | 133 }; |
| 136 | 134 |
| 137 class AppCurrentWindowInternalSetSizeConstraintsFunction | 135 class AppCurrentWindowInternalSetSizeConstraintsFunction |
| 138 : public AppCurrentWindowInternalExtensionFunction { | 136 : public AppCurrentWindowInternalExtensionFunction { |
| 139 public: | 137 public: |
| 140 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setSizeConstraints", | 138 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setSizeConstraints", |
| 141 APP_CURRENTWINDOWINTERNAL_SETSIZECONSTRAINTS) | 139 APP_CURRENTWINDOWINTERNAL_SETSIZECONSTRAINTS) |
| 142 protected: | 140 protected: |
| 143 virtual ~AppCurrentWindowInternalSetSizeConstraintsFunction() {} | 141 virtual ~AppCurrentWindowInternalSetSizeConstraintsFunction() {} |
| 144 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 142 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 145 }; | 143 }; |
| 146 | 144 |
| 147 class AppCurrentWindowInternalSetIconFunction | 145 class AppCurrentWindowInternalSetIconFunction |
| 148 : public AppCurrentWindowInternalExtensionFunction { | 146 : public AppCurrentWindowInternalExtensionFunction { |
| 149 public: | 147 public: |
| 150 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setIcon", | 148 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setIcon", |
| 151 APP_CURRENTWINDOWINTERNAL_SETICON) | 149 APP_CURRENTWINDOWINTERNAL_SETICON) |
| 152 | 150 |
| 153 protected: | 151 protected: |
| 154 virtual ~AppCurrentWindowInternalSetIconFunction() {} | 152 virtual ~AppCurrentWindowInternalSetIconFunction() {} |
| 155 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 153 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 156 }; | 154 }; |
| 157 | 155 |
| 158 class AppCurrentWindowInternalSetBadgeIconFunction | 156 class AppCurrentWindowInternalSetBadgeIconFunction |
| 159 : public AppCurrentWindowInternalExtensionFunction { | 157 : public AppCurrentWindowInternalExtensionFunction { |
| 160 public: | 158 public: |
| 161 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setBadgeIcon", | 159 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setBadgeIcon", |
| 162 APP_CURRENTWINDOWINTERNAL_SETBADGEICON) | 160 APP_CURRENTWINDOWINTERNAL_SETBADGEICON) |
| 163 | 161 |
| 164 protected: | 162 protected: |
| 165 virtual ~AppCurrentWindowInternalSetBadgeIconFunction() {} | 163 virtual ~AppCurrentWindowInternalSetBadgeIconFunction() {} |
| 166 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 164 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 167 }; | 165 }; |
| 168 | 166 |
| 169 class AppCurrentWindowInternalClearBadgeFunction | 167 class AppCurrentWindowInternalClearBadgeFunction |
| 170 : public AppCurrentWindowInternalExtensionFunction { | 168 : public AppCurrentWindowInternalExtensionFunction { |
| 171 public: | 169 public: |
| 172 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.clearBadge", | 170 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.clearBadge", |
| 173 APP_CURRENTWINDOWINTERNAL_CLEARBADGE) | 171 APP_CURRENTWINDOWINTERNAL_CLEARBADGE) |
| 174 | 172 |
| 175 protected: | 173 protected: |
| 176 virtual ~AppCurrentWindowInternalClearBadgeFunction() {} | 174 virtual ~AppCurrentWindowInternalClearBadgeFunction() {} |
| 177 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 175 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 178 }; | 176 }; |
| 179 | 177 |
| 180 class AppCurrentWindowInternalSetShapeFunction | 178 class AppCurrentWindowInternalSetShapeFunction |
| 181 : public AppCurrentWindowInternalExtensionFunction { | 179 : public AppCurrentWindowInternalExtensionFunction { |
| 182 public: | 180 public: |
| 183 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setShape", | 181 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setShape", |
| 184 APP_CURRENTWINDOWINTERNAL_SETSHAPE) | 182 APP_CURRENTWINDOWINTERNAL_SETSHAPE) |
| 185 | 183 |
| 186 protected: | 184 protected: |
| 187 virtual ~AppCurrentWindowInternalSetShapeFunction() {} | 185 virtual ~AppCurrentWindowInternalSetShapeFunction() {} |
| 188 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 186 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 189 }; | 187 }; |
| 190 | 188 |
| 191 class AppCurrentWindowInternalSetAlwaysOnTopFunction | 189 class AppCurrentWindowInternalSetAlwaysOnTopFunction |
| 192 : public AppCurrentWindowInternalExtensionFunction { | 190 : public AppCurrentWindowInternalExtensionFunction { |
| 193 public: | 191 public: |
| 194 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setAlwaysOnTop", | 192 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setAlwaysOnTop", |
| 195 APP_CURRENTWINDOWINTERNAL_SETALWAYSONTOP) | 193 APP_CURRENTWINDOWINTERNAL_SETALWAYSONTOP) |
| 196 | 194 |
| 197 protected: | 195 protected: |
| 198 virtual ~AppCurrentWindowInternalSetAlwaysOnTopFunction() {} | 196 virtual ~AppCurrentWindowInternalSetAlwaysOnTopFunction() {} |
| 199 virtual bool RunWithWindow(apps::AppWindow* window) OVERRIDE; | 197 virtual bool RunWithWindow(AppWindow* window) OVERRIDE; |
| 200 }; | 198 }; |
| 201 | 199 |
| 202 } // namespace extensions | 200 } // namespace extensions |
| 203 | 201 |
| 204 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT
_WINDOW_INTERNAL_API_H_ | 202 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT
_WINDOW_INTERNAL_API_H_ |
| OLD | NEW |