Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: chrome/renderer/extensions/file_browser_handler_custom_bindings.cc

Issue 12313142: Revert 184837 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/file_browser_handler_custom_bindings.cc
===================================================================
--- chrome/renderer/extensions/file_browser_handler_custom_bindings.cc (revision 184858)
+++ chrome/renderer/extensions/file_browser_handler_custom_bindings.cc (working copy)
@@ -13,19 +13,9 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
-namespace extensions {
+namespace {
-FileBrowserHandlerCustomBindings::FileBrowserHandlerCustomBindings(
- v8::Handle<v8::Context> context)
- : ChromeV8Extension(NULL, context) {
- RouteFunction(
- "GetExternalFileEntry",
- base::Bind(&FileBrowserHandlerCustomBindings::GetExternalFileEntry,
- base::Unretained(this)));
-}
-
-v8::Handle<v8::Value> FileBrowserHandlerCustomBindings::GetExternalFileEntry(
- const v8::Arguments& args) {
+v8::Handle<v8::Value> GetExternalFileEntry(const v8::Arguments& args) {
// TODO(zelidrag): Make this magic work on other platforms when file browser
// matures enough on ChromeOS.
#if defined(OS_CHROMEOS)
@@ -43,8 +33,7 @@
v8::String::New("fileFullPath"))));
bool is_directory =
file_def->Get(v8::String::New("fileIsDirectory"))->ToBoolean()->Value();
- WebKit::WebFrame* webframe =
- WebKit::WebFrame::frameForContext(v8_context());
+ WebKit::WebFrame* webframe = WebKit::WebFrame::frameForCurrentContext();
return webframe->createFileEntry(
WebKit::WebFileSystem::TypeExternal,
WebKit::WebString::fromUTF8(file_system_name.c_str()),
@@ -56,4 +45,14 @@
#endif
}
+} // namespace
+
+namespace extensions {
+
+FileBrowserHandlerCustomBindings::FileBrowserHandlerCustomBindings()
+ : ChromeV8Extension(NULL) {
+ RouteStaticFunction("GetExternalFileEntry", &GetExternalFileEntry);
+}
+
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698