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 |
+ |