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/downloads_custom_bindings.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/string_number_conversions.h" |
| 10 #include "grit/renderer_resources.h" |
| 11 #include "v8/include/v8.h" |
| 12 |
| 13 namespace extensions { |
| 14 |
| 15 DownloadsCustomBindings::DownloadsCustomBindings() |
| 16 : ChromeV8Extension(NULL) { |
| 17 RouteStaticFunction("GetFilenameDeterminerId", &GetFilenameDeterminerId); |
| 18 } |
| 19 |
| 20 // Attach an event name to an object. |
| 21 // static |
| 22 v8::Handle<v8::Value> DownloadsCustomBindings::GetFilenameDeterminerId( |
| 23 const v8::Arguments& args) { |
| 24 static int next_event_id = 0; |
| 25 DCHECK_EQ(args.Length(), 0); |
| 26 return v8::Integer::New(++next_event_id); |
| 27 } |
| 28 |
| 29 } // extensions |
| 30 |
OLD | NEW |