OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/extensions/file_browser_private_custom_bindings.h" | 5 #include "chrome/renderer/extensions/file_browser_private_custom_bindings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 std::string path(*v8::String::Utf8Value(args[1])); | 33 std::string path(*v8::String::Utf8Value(args[1])); |
34 | 34 |
35 WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext(); | 35 WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext(); |
36 DCHECK(webframe); | 36 DCHECK(webframe); |
37 return webframe->createFileSystem( | 37 return webframe->createFileSystem( |
38 WebKit::WebFileSystem::TypeExternal, | 38 WebKit::WebFileSystem::TypeExternal, |
39 WebKit::WebString::fromUTF8(name.c_str()), | 39 WebKit::WebString::fromUTF8(name.c_str()), |
40 WebKit::WebString::fromUTF8(path.c_str())); | 40 WebKit::WebString::fromUTF8(path.c_str())); |
41 } | 41 } |
42 | 42 |
43 v8::Handle<v8::FunctionTemplate> | 43 void FileBrowserPrivateCustomBindings::SetNativeFunctions( |
44 FileBrowserPrivateCustomBindings::GetNativeFunction( | 44 v8::Handle<v8::Object> object) { |
45 v8::Handle<v8::String> name) { | 45 RouteFunctionToStatic("GetLocalFileSystem", GetLocalFileSystem, object); |
46 if (name->Equals(v8::String::New("GetLocalFileSystem"))) | |
47 return v8::FunctionTemplate::New(GetLocalFileSystem); | |
48 | |
49 return ChromeV8Extension::GetNativeFunction(name); | |
50 } | 46 } |
51 | 47 |
52 } // namespace extensions | 48 } // namespace extensions |
OLD | NEW |