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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 12026032: Adding supported checks & test for SpeechRecognition APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | tests/html/speechrecognition_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 6276aa70662e848dcf08f2e26ffed8a334f8b82f..a26637db2106e4d89df13a195619a785a8fbcd32 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -20360,7 +20360,7 @@ class SpeechInputResult native "*SpeechInputResult" {
@DomName('SpeechInputResult.utterance')
final String utterance;
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -20368,6 +20368,8 @@ class SpeechInputResult native "*SpeechInputResult" {
@DocsEditable
@DomName('SpeechRecognition')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
@DocsEditable
@@ -20416,7 +20418,9 @@ class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
@DocsEditable
factory SpeechRecognition() => SpeechRecognition._create();
- static SpeechRecognition _create() => JS('SpeechRecognition', 'new SpeechRecognition()');
+
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => JS('bool', '!!(window.SpeechRecognition || window.webkitSpeechRecognition)');
@DocsEditable
@DomName('EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent')
@@ -20513,6 +20517,11 @@ class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
@DocsEditable
@DomName('SpeechRecognition.start')
Stream<Event> get onStart => startEvent.forTarget(this);
+
+ static SpeechRecognition _create() {
+ return JS('SpeechRecognition',
+ 'new (window.SpeechRecognition || window.webkitSpeechRecognition)()');
+ }
}
@DocsEditable
@@ -20561,6 +20570,8 @@ class SpeechRecognitionEvents extends Events {
@DocsEditable
@DomName('SpeechRecognitionAlternative')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionAlternative native "*SpeechRecognitionAlternative" {
@DocsEditable
@@ -20579,6 +20590,8 @@ class SpeechRecognitionAlternative native "*SpeechRecognitionAlternative" {
@DocsEditable
@DomName('SpeechRecognitionError')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionError extends Event native "*SpeechRecognitionError" {
@DocsEditable
@@ -20597,6 +20610,8 @@ class SpeechRecognitionError extends Event native "*SpeechRecognitionError" {
@DocsEditable
@DomName('SpeechRecognitionEvent')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionEvent extends Event native "*SpeechRecognitionEvent" {
@DocsEditable
@@ -20627,6 +20642,8 @@ class SpeechRecognitionEvent extends Event native "*SpeechRecognitionEvent" {
@DocsEditable
@DomName('SpeechRecognitionResult')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental()
class SpeechRecognitionResult native "*SpeechRecognitionResult" {
@DocsEditable
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | tests/html/speechrecognition_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698