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.
4
5#ifndef CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WINDOW_INTERNAL_API_H_
6#define CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WINDOW_INTERNAL_API_H_
7
8#include "chrome/browser/extensions/extension_function.h"
9
10namespace apps {
11class ShellWindow;
12}
13
14namespace extensions {
15
16class AppCurrentWindowInternalExtensionFunction : public SyncExtensionFunction {
17 protected:
18  virtual ~AppCurrentWindowInternalExtensionFunction() {}
19
20  // Invoked with the current shell window.
21  virtual bool RunWithWindow(apps::ShellWindow* window) = 0;
22
23 private:
24  virtual bool RunImpl() OVERRIDE;
25};
26
27class AppCurrentWindowInternalFocusFunction
28    : public AppCurrentWindowInternalExtensionFunction {
29 public:
30  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.focus",
31                             APP_CURRENTWINDOWINTERNAL_FOCUS)
32
33 protected:
34  virtual ~AppCurrentWindowInternalFocusFunction() {}
35  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
36};
37
38class AppCurrentWindowInternalFullscreenFunction
39    : public AppCurrentWindowInternalExtensionFunction {
40 public:
41  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.fullscreen",
42                             APP_CURRENTWINDOWINTERNAL_FULLSCREEN)
43
44 protected:
45  virtual ~AppCurrentWindowInternalFullscreenFunction() {}
46  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
47};
48
49class AppCurrentWindowInternalMaximizeFunction
50    : public AppCurrentWindowInternalExtensionFunction {
51 public:
52  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.maximize",
53                             APP_CURRENTWINDOWINTERNAL_MAXIMIZE)
54
55 protected:
56  virtual ~AppCurrentWindowInternalMaximizeFunction() {}
57  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
58};
59
60class AppCurrentWindowInternalMinimizeFunction
61    : public AppCurrentWindowInternalExtensionFunction {
62 public:
63  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.minimize",
64                             APP_CURRENTWINDOWINTERNAL_MINIMIZE)
65
66 protected:
67  virtual ~AppCurrentWindowInternalMinimizeFunction() {}
68  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
69};
70
71class AppCurrentWindowInternalRestoreFunction
72    : public AppCurrentWindowInternalExtensionFunction {
73 public:
74  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.restore",
75                             APP_CURRENTWINDOWINTERNAL_RESTORE)
76
77 protected:
78  virtual ~AppCurrentWindowInternalRestoreFunction() {}
79  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
80};
81
82class AppCurrentWindowInternalDrawAttentionFunction
83    : public AppCurrentWindowInternalExtensionFunction {
84 public:
85  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.drawAttention",
86                             APP_CURRENTWINDOWINTERNAL_DRAWATTENTION)
87
88 protected:
89  virtual ~AppCurrentWindowInternalDrawAttentionFunction() {}
90  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
91};
92
93class AppCurrentWindowInternalClearAttentionFunction
94    : public AppCurrentWindowInternalExtensionFunction {
95 public:
96  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.clearAttention",
97                             APP_CURRENTWINDOWINTERNAL_CLEARATTENTION)
98
99 protected:
100  virtual ~AppCurrentWindowInternalClearAttentionFunction() {}
101  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
102};
103
104class AppCurrentWindowInternalShowFunction
105    : public AppCurrentWindowInternalExtensionFunction {
106 public:
107  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.show",
108                             APP_CURRENTWINDOWINTERNAL_SHOW)
109
110 protected:
111  virtual ~AppCurrentWindowInternalShowFunction() {}
112  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
113};
114
115class AppCurrentWindowInternalHideFunction
116    : public AppCurrentWindowInternalExtensionFunction {
117 public:
118  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.hide",
119                             APP_CURRENTWINDOWINTERNAL_HIDE)
120
121 protected:
122  virtual ~AppCurrentWindowInternalHideFunction() {}
123  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
124};
125
126class AppCurrentWindowInternalSetBoundsFunction
127    : public AppCurrentWindowInternalExtensionFunction {
128 public:
129  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setBounds",
130                             APP_CURRENTWINDOWINTERNAL_SETBOUNDS)
131 protected:
132  virtual ~AppCurrentWindowInternalSetBoundsFunction() {}
133  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
134};
135
136class AppCurrentWindowInternalSetIconFunction
137    : public AppCurrentWindowInternalExtensionFunction {
138 public:
139  DECLARE_EXTENSION_FUNCTION("app.currentWindowInternal.setIcon",
140                             APP_CURRENTWINDOWINTERNAL_SETICON)
141
142 protected:
143  virtual ~AppCurrentWindowInternalSetIconFunction() {}
144  virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
145};
146
147}  // namespace extensions
148
149#endif  // CHROME_BROWSER_EXTENSIONS_API_APP_CURRENT_WINDOW_INTERNAL_APP_CURRENT_WINDOW_INTERNAL_API_H_
150