Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / webstore_private / webstore_private_api.h
index b320360..852fb47 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <string>
 
+#include "chrome/browser/extensions/active_install_data.h"
 #include "chrome/browser/extensions/bundle_installer.h"
 #include "chrome/browser/extensions/chrome_extension_function.h"
 #include "chrome/browser/extensions/extension_install_prompt.h"
@@ -14,6 +15,7 @@
 #include "chrome/browser/extensions/webstore_installer.h"
 #include "chrome/browser/signin/signin_manager_factory.h"
 #include "chrome/common/extensions/api/webstore_private.h"
+#include "chrome/common/extensions/webstore_install_result.h"
 #include "components/signin/core/browser/signin_tracker.h"
 #include "content/public/browser/gpu_data_manager_observer.h"
 #include "content/public/browser/notification_observer.h"
@@ -170,6 +172,8 @@ class WebstorePrivateBeginInstallWithManifest3Function
 
   scoped_ptr<SigninTracker> signin_tracker_;
 
+  scoped_ptr<ScopedActiveInstall> scoped_active_install_;
+
   // The authuser query parameter value which should be used with CRX download
   // requests. This is empty if authuser should not be set on download requests.
   std::string authuser_;
@@ -199,6 +203,7 @@ class WebstorePrivateCompleteInstallFunction
 
  private:
   scoped_ptr<WebstoreInstaller::Approval> approval_;
+  scoped_ptr<ScopedActiveInstall> scoped_active_install_;
 
   void OnInstallSuccess(const std::string& id);
 };
@@ -345,6 +350,43 @@ class WebstorePrivateSignInFunction : public ChromeAsyncExtensionFunction,
   scoped_ptr<SigninTracker> signin_tracker_;
 };
 
+class WebstorePrivateLaunchEphemeralAppFunction
+    : public ChromeAsyncExtensionFunction {
+ public:
+  DECLARE_EXTENSION_FUNCTION("webstorePrivate.launchEphemeralApp",
+                             WEBSTOREPRIVATE_LAUNCHEPHEMERALAPP)
+
+  WebstorePrivateLaunchEphemeralAppFunction();
+
+ protected:
+  virtual ~WebstorePrivateLaunchEphemeralAppFunction();
+
+  // ExtensionFunction:
+  virtual bool RunAsync() OVERRIDE;
+
+ private:
+  void OnLaunchComplete(webstore_install::Result result,
+                        const std::string& error);
+  void SetResult(
+      api::webstore_private::LaunchEphemeralApp::Results::Result result,
+      const std::string& error);
+};
+
+class WebstorePrivateGetEphemeralAppsEnabledFunction
+    : public ChromeSyncExtensionFunction {
+ public:
+  DECLARE_EXTENSION_FUNCTION("webstorePrivate.getEphemeralAppsEnabled",
+                             WEBSTOREPRIVATE_GETEPHEMERALAPPSENABLED)
+
+  WebstorePrivateGetEphemeralAppsEnabledFunction();
+
+ protected:
+  virtual ~WebstorePrivateGetEphemeralAppsEnabledFunction();
+
+  // ExtensionFunction:
+  virtual bool RunSync() OVERRIDE;
+};
+
 }  // namespace extensions
 
 #endif  // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_