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

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

Issue 11574006: Implement chrome.downloads.onDeterminingFilename() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r180415 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/downloads_custom_bindings.cc
diff --git a/chrome/renderer/extensions/downloads_custom_bindings.cc b/chrome/renderer/extensions/downloads_custom_bindings.cc
new file mode 100644
index 0000000000000000000000000000000000000000..641bbfcfb126e75659f530743b0c795ca1b3beef
--- /dev/null
+++ b/chrome/renderer/extensions/downloads_custom_bindings.cc
@@ -0,0 +1,30 @@
+// 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/downloads_custom_bindings.h"
+
+#include <string>
+
+#include "base/string_number_conversions.h"
+#include "grit/renderer_resources.h"
+#include "v8/include/v8.h"
+
+namespace extensions {
+
+DownloadsCustomBindings::DownloadsCustomBindings()
+ : ChromeV8Extension(NULL) {
+ RouteStaticFunction("GetFilenameDeterminerId", &GetFilenameDeterminerId);
+}
+
+// Attach an event name to an object.
+// static
+v8::Handle<v8::Value> DownloadsCustomBindings::GetFilenameDeterminerId(
+ const v8::Arguments& args) {
+ static int next_event_id = 0;
+ DCHECK_EQ(args.Length(), 0);
+ return v8::String::New(base::IntToString(++next_event_id).c_str());
+}
+
+} // extensions
+

Powered by Google App Engine
This is Rietveld 408576698