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

Side by Side Diff: chrome/renderer/extensions/sync_file_system_custom_bindings.cc

Issue 240603003: Remove ChromeV8Extension & most of ChromeV8Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/sync_file_system_custom_bindings.h" 5 #include "chrome/renderer/extensions/sync_file_system_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/common/extensions/extension_constants.h" 9 #include "extensions/renderer/script_context.h"
10 #include "chrome/renderer/extensions/chrome_v8_context.h"
11 #include "third_party/WebKit/public/web/WebDOMFileSystem.h" 10 #include "third_party/WebKit/public/web/WebDOMFileSystem.h"
12 #include "third_party/WebKit/public/web/WebLocalFrame.h" 11 #include "third_party/WebKit/public/web/WebLocalFrame.h"
13 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
14 #include "webkit/common/fileapi/file_system_util.h" 13 #include "webkit/common/fileapi/file_system_util.h"
15 14
16 namespace extensions { 15 namespace extensions {
17 16
18 SyncFileSystemCustomBindings::SyncFileSystemCustomBindings( 17 SyncFileSystemCustomBindings::SyncFileSystemCustomBindings(
19 Dispatcher* dispatcher, ChromeV8Context* context) 18 ScriptContext* context)
20 : ChromeV8Extension(dispatcher, context) { 19 : ObjectBackedNativeHandler(context) {
21 RouteFunction( 20 RouteFunction(
22 "GetSyncFileSystemObject", 21 "GetSyncFileSystemObject",
23 base::Bind(&SyncFileSystemCustomBindings::GetSyncFileSystemObject, 22 base::Bind(&SyncFileSystemCustomBindings::GetSyncFileSystemObject,
24 base::Unretained(this))); 23 base::Unretained(this)));
25 } 24 }
26 25
27 void SyncFileSystemCustomBindings::GetSyncFileSystemObject( 26 void SyncFileSystemCustomBindings::GetSyncFileSystemObject(
28 const v8::FunctionCallbackInfo<v8::Value>& args) { 27 const v8::FunctionCallbackInfo<v8::Value>& args) {
29 if (args.Length() != 2) { 28 if (args.Length() != 2) {
30 NOTREACHED(); 29 NOTREACHED();
(...skipping 23 matching lines...) Expand all
54 blink::WebLocalFrame::frameForContext(context()->v8_context()); 53 blink::WebLocalFrame::frameForContext(context()->v8_context());
55 args.GetReturnValue().Set( 54 args.GetReturnValue().Set(
56 blink::WebDOMFileSystem::create( 55 blink::WebDOMFileSystem::create(
57 webframe, 56 webframe,
58 blink::WebFileSystemTypeExternal, 57 blink::WebFileSystemTypeExternal,
59 blink::WebString::fromUTF8(name), 58 blink::WebString::fromUTF8(name),
60 GURL(root_url)).toV8Value()); 59 GURL(root_url)).toV8Value());
61 } 60 }
62 61
63 } // namespace extensions 62 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698