summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/extensions/file_browser_private_custom_bindings.cc')
-rw-r--r--chrome/renderer/extensions/file_browser_private_custom_bindings.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/chrome/renderer/extensions/file_browser_private_custom_bindings.cc b/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
index 355e838..ea72c0b 100644
--- a/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
+++ b/chrome/renderer/extensions/file_browser_private_custom_bindings.cc
@@ -13,9 +13,18 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
-namespace {
+namespace extensions {
+
+FileBrowserPrivateCustomBindings::FileBrowserPrivateCustomBindings(
+ Dispatcher* dispatcher, v8::Handle<v8::Context> context)
+ : ChromeV8Extension(dispatcher, context) {
+ RouteFunction(
+ "GetLocalFileSystem",
+ base::Bind(&FileBrowserPrivateCustomBindings::GetLocalFileSystem,
+ base::Unretained(this)));
+}
-static v8::Handle<v8::Value> GetLocalFileSystem(
+v8::Handle<v8::Value> FileBrowserPrivateCustomBindings::GetLocalFileSystem(
const v8::Arguments& args) {
DCHECK(args.Length() == 2);
DCHECK(args[0]->IsString());
@@ -23,7 +32,7 @@ static v8::Handle<v8::Value> GetLocalFileSystem(
std::string name(*v8::String::Utf8Value(args[0]));
std::string path(*v8::String::Utf8Value(args[1]));
- WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext();
+ WebKit::WebFrame* webframe = WebKit::WebFrame::frameForContext(v8_context());
DCHECK(webframe);
return webframe->createFileSystem(
WebKit::WebFileSystem::TypeExternal,
@@ -31,13 +40,4 @@ static v8::Handle<v8::Value> GetLocalFileSystem(
WebKit::WebString::fromUTF8(path.c_str()));
}
-} // namespace
-
-namespace extensions {
-
-FileBrowserPrivateCustomBindings::FileBrowserPrivateCustomBindings()
- : ChromeV8Extension(NULL) {
- RouteStaticFunction("GetLocalFileSystem", &GetLocalFileSystem);
-}
-
} // namespace extensions