Chromium Code Reviews| Index: chrome/renderer/extensions/webstore_bindings.h |
| diff --git a/chrome/renderer/extensions/webstore_bindings.h b/chrome/renderer/extensions/webstore_bindings.h |
| index 641fddd50888c3bbfd34d38102484fdbb2814111..012af003439e94315db59b9d87b7f361e15ebf9d 100644 |
| --- a/chrome/renderer/extensions/webstore_bindings.h |
| +++ b/chrome/renderer/extensions/webstore_bindings.h |
| @@ -7,39 +7,43 @@ |
| #include "base/compiler_specific.h" |
| #include "base/macros.h" |
| +#include "chrome/common/extensions/mojom/inline_install.mojom.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 "mojo/public/cpp/bindings/binding_set.h" |
| namespace blink { |
| class WebLocalFrame; |
| } |
| namespace extensions { |
| +class ScriptContext; |
| // 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 ObjectBackedNativeHandler, |
| - public ChromeV8ExtensionHandler { |
| + public ChromeV8ExtensionHandler, |
| + public mojom::InlineInstallProgressListener { |
| public: |
| explicit WebstoreBindings(ScriptContext* context); |
| + ~WebstoreBindings() override; |
| - // IPC::Listener |
| + // IPC::Listener: |
| bool OnMessageReceived(const IPC::Message& message) override; |
| + // mojom::InlineInstallProgressListener |
|
palmer
2017/05/08 23:39:03
Infinitesimal :) nit: Use a :, same as on line 33.
catmullings
2017/05/23 02:38:37
Done.
|
| + void InlineInstallResponse(int install_id, |
| + bool success, |
| + const std::string& error, |
| + webstore_install::Result result) override; |
| + void InlineInstallStageChanged(api::webstore::InstallStage stage) override; |
| + void InlineInstallDownloadProgress(int percent_downloaded) override; |
| + |
| private: |
| void Install(const v8::FunctionCallbackInfo<v8::Value>& args); |
| - 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 |
| // frame. On success, true will be returned and the |webstore_item_id| |
| @@ -51,6 +55,11 @@ class WebstoreBindings : public ObjectBackedNativeHandler, |
| std::string* webstore_item_id, |
| std::string* error); |
| + mojom::InlineInstallerAssociatedPtr inline_installer_; |
| + |
| + mojo::BindingSet<mojom::InlineInstallProgressListener> |
| + install_progress_listener_bindings_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(WebstoreBindings); |
| }; |