Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: chrome/renderer/extensions/webstore_bindings.h

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/webstore_bindings.h
diff --git a/chrome/renderer/extensions/webstore_bindings.h b/chrome/renderer/extensions/webstore_bindings.h
index 098f888c81aeed06ebe74a226aa5bdb65127ed0c..33ac48eb0d9f8d638258b7b7fb31d080bbb57af4 100644
--- a/chrome/renderer/extensions/webstore_bindings.h
+++ b/chrome/renderer/extensions/webstore_bindings.h
@@ -8,21 +8,37 @@
#include "base/compiler_specific.h"
#include "chrome/renderer/extensions/chrome_v8_extension.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
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 ChromeV8Extension,
+ public ChromeV8ExtensionHandler {
public:
- explicit WebstoreBindings(ExtensionDispatcher* dispatcher);
+ explicit WebstoreBindings(ExtensionDispatcher* dispatcher,
+ ChromeV8Context* context);
- protected:
- virtual ChromeV8ExtensionHandler* CreateHandler(
- ChromeV8Context* context) OVERRIDE;
+ // IPC::Channel::Listener
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
private:
+ v8::Handle<v8::Value> Install(const v8::Arguments& args);
+
+ void OnInlineWebstoreInstallResponse(
+ int install_id, bool success, const std::string& error);
+
+ // 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|
+ // parameter will be populated with the ID. On failure, false will be returned
+ // and |error| will be populated with the error.
+ static bool GetWebstoreItemIdFromFrame(
+ WebKit::WebFrame* frame, const std::string& preferred_store_link_url,
+ std::string* webstore_item_id, std::string* error);
+
DISALLOW_COPY_AND_ASSIGN(WebstoreBindings);
};
« no previous file with comments | « chrome/renderer/extensions/web_request_custom_bindings.cc ('k') | chrome/renderer/extensions/webstore_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698