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/media_galleries_custom_bindings.h" | 5 #include "chrome/renderer/extensions/media_galleries_custom_bindings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 return v8::Undefined(); | 49 return v8::Undefined(); |
50 } | 50 } |
51 std::string name(*v8::String::Utf8Value(args[1])); | 51 std::string name(*v8::String::Utf8Value(args[1])); |
52 if (name.empty()) { | 52 if (name.empty()) { |
53 NOTREACHED(); | 53 NOTREACHED(); |
54 return v8::Undefined(); | 54 return v8::Undefined(); |
55 } | 55 } |
56 | 56 |
57 WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext(); | 57 WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext(); |
58 const GURL origin = GURL(webframe->document().securityOrigin().toString()); | 58 const GURL origin = GURL(webframe->document().securityOrigin().toString()); |
59 const GURL root_url = | 59 const std::string root_url = |
60 fileapi::GetFileSystemRootURI(origin, fileapi::kFileSystemTypeIsolated); | 60 fileapi::GetIsolatedFileSystemRootURIString( |
61 const std::string url = | 61 origin, fsid, extension_misc::kMediaFileSystemPathPart); |
62 base::StringPrintf("%s%s/%s/", root_url.spec().c_str(), fsid.c_str(), | |
63 extension_misc::kMediaFileSystemPathPart); | |
64 return webframe->createFileSystem(WebKit::WebFileSystem::TypeIsolated, | 62 return webframe->createFileSystem(WebKit::WebFileSystem::TypeIsolated, |
65 WebKit::WebString::fromUTF8(name), | 63 WebKit::WebString::fromUTF8(name), |
66 WebKit::WebString::fromUTF8(url)); | 64 WebKit::WebString::fromUTF8(root_url)); |
67 } | 65 } |
68 | 66 |
69 v8::Handle<v8::Value> MediaGalleriesCustomBindings::ExtractEmbeddedThumbnails( | 67 v8::Handle<v8::Value> MediaGalleriesCustomBindings::ExtractEmbeddedThumbnails( |
70 const v8::Arguments& args) { | 68 const v8::Arguments& args) { |
71 if (args.Length() != 1) { | 69 if (args.Length() != 1) { |
72 NOTREACHED() << "Bad arguments"; | 70 NOTREACHED() << "Bad arguments"; |
73 return v8::Undefined(); | 71 return v8::Undefined(); |
74 } | 72 } |
75 // TODO(vandebo) Check that the object is a FileEntry. | 73 // TODO(vandebo) Check that the object is a FileEntry. |
76 | 74 |
77 // TODO(vandebo) Create and return a Directory entry object. | 75 // TODO(vandebo) Create and return a Directory entry object. |
78 return v8::Null(); | 76 return v8::Null(); |
79 } | 77 } |
80 | 78 |
81 } // namespace extensions | 79 } // namespace extensions |
OLD | NEW |