OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_process_bindings.h" | 5 #include "chrome/renderer/extensions/extension_process_bindings.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // Attach an event name to an object. | 308 // Attach an event name to an object. |
309 static v8::Handle<v8::Value> GetLocalFileSystem( | 309 static v8::Handle<v8::Value> GetLocalFileSystem( |
310 const v8::Arguments& args) { | 310 const v8::Arguments& args) { |
311 DCHECK(args.Length() == 2); | 311 DCHECK(args.Length() == 2); |
312 DCHECK(args[0]->IsString()); | 312 DCHECK(args[0]->IsString()); |
313 DCHECK(args[1]->IsString()); | 313 DCHECK(args[1]->IsString()); |
314 std::string name(*v8::String::Utf8Value(args[0])); | 314 std::string name(*v8::String::Utf8Value(args[0])); |
315 std::string path(*v8::String::Utf8Value(args[1])); | 315 std::string path(*v8::String::Utf8Value(args[1])); |
316 | 316 |
317 WebFrame* webframe = WebFrame::frameForCurrentContext(); | 317 WebFrame* webframe = WebFrame::frameForCurrentContext(); |
318 return webframe->createFileSystem(fileapi::kFileSystemTypeLocal, | 318 return webframe->createFileSystem(WebKit::WebFileSystem::TypeExternal, |
319 WebKit::WebString::fromUTF8(name.c_str()), | 319 WebKit::WebString::fromUTF8(name.c_str()), |
320 WebKit::WebString::fromUTF8(path.c_str())); | 320 WebKit::WebString::fromUTF8(path.c_str())); |
321 } | 321 } |
322 | 322 |
323 // Creates a new messaging channel to the tab with the given ID. | 323 // Creates a new messaging channel to the tab with the given ID. |
324 static v8::Handle<v8::Value> OpenChannelToTab(const v8::Arguments& args) { | 324 static v8::Handle<v8::Value> OpenChannelToTab(const v8::Arguments& args) { |
325 // Get the current RenderView so that we can send a routed IPC message from | 325 // Get the current RenderView so that we can send a routed IPC message from |
326 // the correct source. | 326 // the correct source. |
327 RenderView* renderview = bindings_utils::GetRenderViewForCurrentContext(); | 327 RenderView* renderview = bindings_utils::GetRenderViewForCurrentContext(); |
328 if (!renderview) | 328 if (!renderview) |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 ExtensionProcessBindings::ThrowPermissionDeniedException( | 658 ExtensionProcessBindings::ThrowPermissionDeniedException( |
659 const std::string& function_name) { | 659 const std::string& function_name) { |
660 static const char kMessage[] = | 660 static const char kMessage[] = |
661 "You do not have permission to use '%s'. Be sure to declare" | 661 "You do not have permission to use '%s'. Be sure to declare" |
662 " in your manifest what permissions you need."; | 662 " in your manifest what permissions you need."; |
663 std::string error_msg = StringPrintf(kMessage, function_name.c_str()); | 663 std::string error_msg = StringPrintf(kMessage, function_name.c_str()); |
664 | 664 |
665 return v8::ThrowException(v8::Exception::Error( | 665 return v8::ThrowException(v8::Exception::Error( |
666 v8::String::New(error_msg.c_str()))); | 666 v8::String::New(error_msg.c_str()))); |
667 } | 667 } |
OLD | NEW |