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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WINDOW_INTERNAL_API_H_
6 #define EXTENSIONS_BROWSER_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WINDOW_INTERNAL_API_H_
8 #include "extensions/browser/extension_function.h"
10 namespace extensions {
14 class AppCurrentWindowInternalExtensionFunction : public SyncExtensionFunction {
16 virtual ~AppCurrentWindowInternalExtensionFunction() {}
18 // Invoked with the current app window.
19 virtual bool RunWithWindow(AppWindow* window) = 0;
22 virtual bool RunSync() OVERRIDE;
25 class AppCurrentWindowInternalFocusFunction
26 : public AppCurrentWindowInternalExtensionFunction {
28 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.focus",
29 APP_CURRENTWINDOWINTERNAL_FOCUS)
32 virtual ~AppCurrentWindowInternalFocusFunction() {}
33 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
36 class AppCurrentWindowInternalFullscreenFunction
37 : public AppCurrentWindowInternalExtensionFunction {
39 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.fullscreen",
40 APP_CURRENTWINDOWINTERNAL_FULLSCREEN)
43 virtual ~AppCurrentWindowInternalFullscreenFunction() {}
44 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
47 class AppCurrentWindowInternalMaximizeFunction
48 : public AppCurrentWindowInternalExtensionFunction {
50 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.maximize",
51 APP_CURRENTWINDOWINTERNAL_MAXIMIZE)
54 virtual ~AppCurrentWindowInternalMaximizeFunction() {}
55 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
58 class AppCurrentWindowInternalMinimizeFunction
59 : public AppCurrentWindowInternalExtensionFunction {
61 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.minimize",
62 APP_CURRENTWINDOWINTERNAL_MINIMIZE)
65 virtual ~AppCurrentWindowInternalMinimizeFunction() {}
66 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
69 class AppCurrentWindowInternalRestoreFunction
70 : public AppCurrentWindowInternalExtensionFunction {
72 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.restore",
73 APP_CURRENTWINDOWINTERNAL_RESTORE)
76 virtual ~AppCurrentWindowInternalRestoreFunction() {}
77 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
80 class AppCurrentWindowInternalDrawAttentionFunction
81 : public AppCurrentWindowInternalExtensionFunction {
83 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.drawAttention",
84 APP_CURRENTWINDOWINTERNAL_DRAWATTENTION)
87 virtual ~AppCurrentWindowInternalDrawAttentionFunction() {}
88 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
91 class AppCurrentWindowInternalClearAttentionFunction
92 : public AppCurrentWindowInternalExtensionFunction {
94 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.clearAttention",
95 APP_CURRENTWINDOWINTERNAL_CLEARATTENTION)
98 virtual ~AppCurrentWindowInternalClearAttentionFunction() {}
99 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
102 class AppCurrentWindowInternalShowFunction
103 : public AppCurrentWindowInternalExtensionFunction {
105 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.show",
106 APP_CURRENTWINDOWINTERNAL_SHOW)
109 virtual ~AppCurrentWindowInternalShowFunction() {}
110 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
113 class AppCurrentWindowInternalHideFunction
114 : public AppCurrentWindowInternalExtensionFunction {
116 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.hide",
117 APP_CURRENTWINDOWINTERNAL_HIDE)
120 virtual ~AppCurrentWindowInternalHideFunction() {}
121 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
124 class AppCurrentWindowInternalSetBoundsFunction
125 : public AppCurrentWindowInternalExtensionFunction {
127 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setBounds",
128 APP_CURRENTWINDOWINTERNAL_SETBOUNDS)
130 virtual ~AppCurrentWindowInternalSetBoundsFunction() {}
131 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
134 class AppCurrentWindowInternalSetSizeConstraintsFunction
135 : public AppCurrentWindowInternalExtensionFunction {
137 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setSizeConstraints",
138 APP_CURRENTWINDOWINTERNAL_SETSIZECONSTRAINTS)
140 virtual ~AppCurrentWindowInternalSetSizeConstraintsFunction() {}
141 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
144 class AppCurrentWindowInternalSetIconFunction
145 : public AppCurrentWindowInternalExtensionFunction {
147 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setIcon",
148 APP_CURRENTWINDOWINTERNAL_SETICON)
151 virtual ~AppCurrentWindowInternalSetIconFunction() {}
152 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
155 class AppCurrentWindowInternalSetBadgeIconFunction
156 : public AppCurrentWindowInternalExtensionFunction {
158 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setBadgeIcon",
159 APP_CURRENTWINDOWINTERNAL_SETBADGEICON)
162 virtual ~AppCurrentWindowInternalSetBadgeIconFunction() {}
163 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
166 class AppCurrentWindowInternalClearBadgeFunction
167 : public AppCurrentWindowInternalExtensionFunction {
169 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.clearBadge",
170 APP_CURRENTWINDOWINTERNAL_CLEARBADGE)
173 virtual ~AppCurrentWindowInternalClearBadgeFunction() {}
174 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
177 class AppCurrentWindowInternalSetShapeFunction
178 : public AppCurrentWindowInternalExtensionFunction {
180 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setShape",
181 APP_CURRENTWINDOWINTERNAL_SETSHAPE)
184 virtual ~AppCurrentWindowInternalSetShapeFunction() {}
185 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
188 class AppCurrentWindowInternalSetAlwaysOnTopFunction
189 : public AppCurrentWindowInternalExtensionFunction {
191 DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setAlwaysOnTop",
192 APP_CURRENTWINDOWINTERNAL_SETALWAYSONTOP)
195 virtual ~AppCurrentWindowInternalSetAlwaysOnTopFunction() {}
196 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
199 class AppCurrentWindowInternalSetVisibleOnAllWorkspacesFunction
200 : public AppCurrentWindowInternalExtensionFunction {
202 DECLARE_EXTENSION_FUNCTION(
203 "app.currentWindowInternal.setVisibleOnAllWorkspaces",
204 APP_CURRENTWINDOWINTERNAL_SETVISIBLEONALLWORKSPACES)
207 virtual ~AppCurrentWindowInternalSetVisibleOnAllWorkspacesFunction() {}
208 virtual bool RunWithWindow(AppWindow* window) OVERRIDE;
211 } // namespace extensions
213 #endif // EXTENSIONS_BROWSER_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WINDOW_INTERNAL_API_H_