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_system_natives.h" | 5 #include "chrome/renderer/extensions/file_system_natives.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" |
11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
12 #include "chrome/renderer/extensions/chrome_v8_context.h" | 12 #include "chrome/renderer/extensions/chrome_v8_context.h" |
13 #include "chrome/renderer/extensions/user_script_slave.h" | 13 #include "chrome/renderer/extensions/user_script_slave.h" |
14 #include "extensions/common/constants.h" | 14 #include "extensions/common/constants.h" |
15 #include "grit/renderer_resources.h" | 15 #include "grit/renderer_resources.h" |
16 #include "third_party/WebKit/public/platform/WebString.h" | 16 #include "third_party/WebKit/public/platform/WebString.h" |
17 #include "third_party/WebKit/public/web/WebDOMError.h" | 17 #include "third_party/WebKit/public/web/WebDOMError.h" |
18 #include "third_party/WebKit/public/web/WebDOMFileSystem.h" | 18 #include "third_party/WebKit/public/web/WebDOMFileSystem.h" |
19 #include "third_party/WebKit/public/web/WebFrame.h" | 19 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
20 #include "webkit/common/fileapi/file_system_types.h" | 20 #include "webkit/common/fileapi/file_system_types.h" |
21 #include "webkit/common/fileapi/file_system_util.h" | 21 #include "webkit/common/fileapi/file_system_util.h" |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 | 24 |
25 FileSystemNatives::FileSystemNatives(ChromeV8Context* context) | 25 FileSystemNatives::FileSystemNatives(ChromeV8Context* context) |
26 : ObjectBackedNativeHandler(context) { | 26 : ObjectBackedNativeHandler(context) { |
27 RouteFunction("GetFileEntry", | 27 RouteFunction("GetFileEntry", |
28 base::Bind(&FileSystemNatives::GetFileEntry, base::Unretained(this))); | 28 base::Bind(&FileSystemNatives::GetFileEntry, base::Unretained(this))); |
29 RouteFunction("GetIsolatedFileSystem", | 29 RouteFunction("GetIsolatedFileSystem", |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 std::string message(*v8::String::Utf8Value(args[1])); | 150 std::string message(*v8::String::Utf8Value(args[1])); |
151 // message is optional hence empty is fine. | 151 // message is optional hence empty is fine. |
152 | 152 |
153 blink::WebDOMError dom_error = blink::WebDOMError::create( | 153 blink::WebDOMError dom_error = blink::WebDOMError::create( |
154 blink::WebString::fromUTF8(name), | 154 blink::WebString::fromUTF8(name), |
155 blink::WebString::fromUTF8(message)); | 155 blink::WebString::fromUTF8(message)); |
156 args.GetReturnValue().Set(dom_error.toV8Value()); | 156 args.GetReturnValue().Set(dom_error.toV8Value()); |
157 } | 157 } |
158 | 158 |
159 } // namespace extensions | 159 } // namespace extensions |
OLD | NEW |