Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / renderer / extensions / webstore_bindings.h
index b729150..c74c90c 100644 (file)
@@ -6,20 +6,20 @@
 #define CHROME_RENDERER_EXTENSIONS_WEBSTORE_BINDINGS_H_
 
 #include "base/compiler_specific.h"
-#include "chrome/renderer/extensions/chrome_v8_extension.h"
+#include "chrome/common/extensions/webstore_install_result.h"
+#include "chrome/renderer/extensions/chrome_v8_extension_handler.h"
+#include "extensions/renderer/object_backed_native_handler.h"
 #include "third_party/WebKit/public/web/WebFrame.h"
 
 namespace extensions {
-class ChromeV8Context;
 
 // A V8 extension that creates an object at window.chrome.webstore. This object
 // allows JavaScript to initiate inline installs of apps that are listed in the
 // Chrome Web Store (CWS).
-class WebstoreBindings : public ChromeV8Extension,
+class WebstoreBindings : public ObjectBackedNativeHandler,
                          public ChromeV8ExtensionHandler {
  public:
-  explicit WebstoreBindings(Dispatcher* dispatcher,
-                            ChromeV8Context* context);
+  explicit WebstoreBindings(ScriptContext* context);
 
   // IPC::Listener
   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
@@ -27,8 +27,14 @@ class WebstoreBindings : public ChromeV8Extension,
  private:
   void Install(const v8::FunctionCallbackInfo<v8::Value>& args);
 
-  void OnInlineWebstoreInstallResponse(
-      int install_id, bool success, const std::string& error);
+  void OnInlineWebstoreInstallResponse(int install_id,
+                                       bool success,
+                                       const std::string& error,
+                                       webstore_install::Result result);
+
+  void OnInlineInstallStageChanged(int stage);
+
+  void OnInlineInstallDownloadProgress(int percent_downloaded);
 
   // Extracts a Web Store item ID from a <link rel="chrome-webstore-item"
   // href="https://chrome.google.com/webstore/detail/id"> node found in the