| Index: chrome/renderer/extensions/media_gallery_custom_bindings.cc
|
| diff --git a/chrome/renderer/extensions/media_gallery_custom_bindings.cc b/chrome/renderer/extensions/media_gallery_custom_bindings.cc
|
| deleted file mode 100644
|
| index 445d74a39a8e21e5ec487f25439a3cc86fc58dfe..0000000000000000000000000000000000000000
|
| --- a/chrome/renderer/extensions/media_gallery_custom_bindings.cc
|
| +++ /dev/null
|
| @@ -1,81 +0,0 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "chrome/renderer/extensions/media_gallery_custom_bindings.h"
|
| -
|
| -#include <string>
|
| -
|
| -#include "base/file_path.h"
|
| -#include "base/stringprintf.h"
|
| -#include "chrome/common/extensions/extension_constants.h"
|
| -#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
|
| -#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
|
| -#include "v8/include/v8.h"
|
| -#include "webkit/fileapi/file_system_util.h"
|
| -
|
| -namespace extensions {
|
| -
|
| -MediaGalleryCustomBindings::MediaGalleryCustomBindings()
|
| - : ChromeV8Extension(NULL) {
|
| - RouteFunction(
|
| - "GetMediaFileSystemObject",
|
| - base::Bind(&MediaGalleryCustomBindings::GetMediaFileSystemObject,
|
| - base::Unretained(this)));
|
| - RouteFunction(
|
| - "ExtractEmbeddedThumbnails",
|
| - base::Bind(&MediaGalleryCustomBindings::ExtractEmbeddedThumbnails,
|
| - base::Unretained(this)));
|
| -}
|
| -
|
| -v8::Handle<v8::Value> MediaGalleryCustomBindings::GetMediaFileSystemObject(
|
| - const v8::Arguments& args) {
|
| - if (args.Length() != 2) {
|
| - NOTREACHED();
|
| - return v8::Undefined();
|
| - }
|
| - if (!args[0]->IsString()) {
|
| - NOTREACHED();
|
| - return v8::Undefined();
|
| - }
|
| - if (!args[1]->IsString()) {
|
| - NOTREACHED();
|
| - return v8::Undefined();
|
| - }
|
| -
|
| - std::string fsid(*v8::String::Utf8Value(args[0]));
|
| - if (fsid.empty()) {
|
| - NOTREACHED();
|
| - return v8::Undefined();
|
| - }
|
| - std::string name(*v8::String::Utf8Value(args[1]));
|
| - if (name.empty()) {
|
| - NOTREACHED();
|
| - return v8::Undefined();
|
| - }
|
| -
|
| - WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext();
|
| - const GURL origin = GURL(webframe->document().securityOrigin().toString());
|
| - const GURL root_url =
|
| - fileapi::GetFileSystemRootURI(origin, fileapi::kFileSystemTypeIsolated);
|
| - const std::string url =
|
| - base::StringPrintf("%s%s/%s/", root_url.spec().c_str(), fsid.c_str(),
|
| - extension_misc::kMediaFileSystemPathPart);
|
| - return webframe->createFileSystem(WebKit::WebFileSystem::TypeIsolated,
|
| - WebKit::WebString::fromUTF8(name),
|
| - WebKit::WebString::fromUTF8(url));
|
| -}
|
| -
|
| -v8::Handle<v8::Value> MediaGalleryCustomBindings::ExtractEmbeddedThumbnails(
|
| - const v8::Arguments& args) {
|
| - if (args.Length() != 1) {
|
| - NOTREACHED() << "Bad arguments";
|
| - return v8::Undefined();
|
| - }
|
| - // TODO(vandebo) Check that the object is a FileEntry.
|
| -
|
| - // TODO(vandebo) Create and return a Directory entry object.
|
| - return v8::Null();
|
| -}
|
| -
|
| -} // namespace extensions
|
|
|