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