OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/renderer/extensions/media_gallery_custom_bindings.h" | |
6 | |
7 #include "content/public/renderer/render_view.h" | |
8 #include "grit/renderer_resources.h" | |
9 #include "v8/include/v8.h" | |
10 | |
11 namespace extensions { | |
12 | |
13 MediaGalleryCustomBindings::MediaGalleryCustomBindings() | |
14 : ChromeV8Extension(NULL) { | |
15 RouteStaticFunction("CreateMediaGalleryObject", &CreateMediaGalleryObject); | |
16 } | |
17 | |
18 // static | |
19 v8::Handle<v8::Value> MediaGalleryCustomBindings::CreateMediaGalleryObject( | |
20 const v8::Arguments& args) { | |
21 if (args.Length() != 3 || !args[0]->IsUint32() || args[1]->IsNull() || | |
22 !args[1]->IsString() || !args[2]->IsUint32()) { | |
23 NOTREACHED() << "Bad arguments"; | |
24 return v8::Undefined(); | |
25 } | |
26 | |
27 std::string name; | |
28 name = *v8::String::Utf8Value(args[1]->ToString()); | |
29 if (name.empty()) | |
30 return v8::Undefined(); | |
31 | |
32 // TODO(vandebo) Create and return a MediaGallery object. | |
33 // int id = args[0]->Uint32Value(); | |
34 // int flags = args[2]->Uint32Value(); | |
35 return v8::Undefined(); | |
36 } | |
37 | |
38 } // namespace extensions | |
OLD | NEW |