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

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

Issue 9358076: Initial extension bindings for Media Gallery API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment Created 8 years, 9 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/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
new file mode 100644
index 0000000000000000000000000000000000000000..d5d6807c9105fc90b16c2f72ab30eddecfe4a579
--- /dev/null
+++ b/chrome/renderer/extensions/media_gallery_custom_bindings.cc
@@ -0,0 +1,38 @@
+// 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 "content/public/renderer/render_view.h"
+#include "grit/renderer_resources.h"
+#include "v8/include/v8.h"
+
+namespace extensions {
+
+MediaGalleryCustomBindings::MediaGalleryCustomBindings()
+ : ChromeV8Extension(NULL) {
+ RouteStaticFunction("CreateMediaGalleryObject", &CreateMediaGalleryObject);
+}
+
+// static
+v8::Handle<v8::Value> MediaGalleryCustomBindings::CreateMediaGalleryObject(
+ const v8::Arguments& args) {
+ if (args.Length() != 3 || !args[0]->IsUint32() || args[1]->IsNull() ||
+ !args[1]->IsString() || !args[2]->IsUint32()) {
+ NOTREACHED() << "Bad arguments";
+ return v8::Undefined();
+ }
+
+ std::string name;
+ name = *v8::String::Utf8Value(args[1]->ToString());
+ if (name.empty())
+ return v8::Undefined();
+
+ // TODO(vandebo) Create and return a MediaGallery object.
+ // int id = args[0]->Uint32Value();
+ // int flags = args[2]->Uint32Value();
+ return v8::Undefined();
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698