Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / screenlock_private / screenlock_private_api.h
index 1abbf64..dbdf8f4 100644 (file)
 #include "chrome/browser/signin/screenlock_bridge.h"
 #include "extensions/browser/browser_context_keyed_api_factory.h"
 
-namespace gfx {
-class Image;
-}
-
 namespace extensions {
 
 class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction {
@@ -41,80 +37,13 @@ class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction {
   DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction);
 };
 
-class ScreenlockPrivateShowMessageFunction
-    : public ChromeAsyncExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage",
-                             SCREENLOCKPRIVATE_SHOWMESSAGE)
-  ScreenlockPrivateShowMessageFunction();
-  virtual bool RunAsync() OVERRIDE;
-
- private:
-  virtual ~ScreenlockPrivateShowMessageFunction();
-  DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction);
-};
-
-class ScreenlockPrivateShowCustomIconFunction
-    : public ChromeAsyncExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showCustomIcon",
-                             SCREENLOCKPRIVATE_SHOWCUSTOMICON)
-  ScreenlockPrivateShowCustomIconFunction();
-  virtual bool RunAsync() OVERRIDE;
-
- private:
-  virtual ~ScreenlockPrivateShowCustomIconFunction();
-  void OnImageLoaded(const gfx::Image& image);
-  DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowCustomIconFunction);
-};
-
-class ScreenlockPrivateHideCustomIconFunction
-    : public ChromeAsyncExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("screenlockPrivate.hideCustomIcon",
-                             SCREENLOCKPRIVATE_HIDECUSTOMICON)
-  ScreenlockPrivateHideCustomIconFunction();
-  virtual bool RunAsync() OVERRIDE;
-
- private:
-  virtual ~ScreenlockPrivateHideCustomIconFunction();
-  void OnImageLoaded(const gfx::Image& image);
-  DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateHideCustomIconFunction);
-};
-
-class ScreenlockPrivateSetAuthTypeFunction
-    : public ChromeAsyncExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setAuthType",
-                             SCREENLOCKPRIVATE_SETAUTHTYPE)
-  ScreenlockPrivateSetAuthTypeFunction();
-  virtual bool RunAsync() OVERRIDE;
-
- private:
-  virtual ~ScreenlockPrivateSetAuthTypeFunction();
-  DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetAuthTypeFunction);
-};
-
-class ScreenlockPrivateGetAuthTypeFunction
-    : public ChromeAsyncExtensionFunction {
- public:
-  DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getAuthType",
-                             SCREENLOCKPRIVATE_GETAUTHTYPE)
-  ScreenlockPrivateGetAuthTypeFunction();
-  virtual bool RunAsync() OVERRIDE;
-
- private:
-  virtual ~ScreenlockPrivateGetAuthTypeFunction();
-  DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetAuthTypeFunction);
-};
-
 class ScreenlockPrivateAcceptAuthAttemptFunction
-    : public ChromeAsyncExtensionFunction {
+    : public ChromeSyncExtensionFunction {
  public:
   DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt",
                              SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT)
   ScreenlockPrivateAcceptAuthAttemptFunction();
-  virtual bool RunAsync() OVERRIDE;
+  virtual bool RunSync() OVERRIDE;
 
  private:
   virtual ~ScreenlockPrivateAcceptAuthAttemptFunction();
@@ -127,7 +56,7 @@ class ScreenlockPrivateEventRouter : public extensions::BrowserContextKeyedAPI,
   explicit ScreenlockPrivateEventRouter(content::BrowserContext* context);
   virtual ~ScreenlockPrivateEventRouter();
 
-  void OnAuthAttempted(ScreenlockBridge::LockHandler::AuthType auth_type,
+  bool OnAuthAttempted(ScreenlockBridge::LockHandler::AuthType auth_type,
                        const std::string& value);
 
   // BrowserContextKeyedAPI
@@ -139,6 +68,7 @@ class ScreenlockPrivateEventRouter : public extensions::BrowserContextKeyedAPI,
   // ScreenlockBridge::Observer
   virtual void OnScreenDidLock() OVERRIDE;
   virtual void OnScreenDidUnlock() OVERRIDE;
+  virtual void OnFocusedUserChanged(const std::string& user_id) OVERRIDE;
 
  private:
   friend class extensions::BrowserContextKeyedAPIFactory<