OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/extensions/tts_custom_bindings.h" | 5 #include "chrome/renderer/extensions/tts_custom_bindings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/common/extensions/extension_action.h" | |
10 #include "grit/renderer_resources.h" | 9 #include "grit/renderer_resources.h" |
11 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
12 | 11 |
13 namespace extensions { | 12 namespace extensions { |
14 | 13 |
15 TTSCustomBindings::TTSCustomBindings() | 14 TTSCustomBindings::TTSCustomBindings() |
16 : ChromeV8Extension(NULL) { | 15 : ChromeV8Extension(NULL) { |
17 RouteStaticFunction("GetNextTTSEventId", &GetNextTTSEventId); | 16 RouteStaticFunction("GetNextTTSEventId", &GetNextTTSEventId); |
18 } | 17 } |
19 | 18 |
20 // static | 19 // static |
21 v8::Handle<v8::Value> TTSCustomBindings::GetNextTTSEventId( | 20 v8::Handle<v8::Value> TTSCustomBindings::GetNextTTSEventId( |
22 const v8::Arguments& args) { | 21 const v8::Arguments& args) { |
23 // Note: this works because the TTS API only works in the | 22 // Note: this works because the TTS API only works in the |
24 // extension process, not content scripts. | 23 // extension process, not content scripts. |
25 static int next_tts_event_id = 1; | 24 static int next_tts_event_id = 1; |
26 return v8::Integer::New(next_tts_event_id++); | 25 return v8::Integer::New(next_tts_event_id++); |
27 } | 26 } |
28 | 27 |
29 } // extensions | 28 } // extensions |
OLD | NEW |