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

Side by Side Diff: chrome/common/extensions/docs/examples/api/speechInput/basic/background.html

Issue 8536022: Adding static documentation to the speech input extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing nits and adding a example. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <script>
3 function checkStart() {
Satish 2011/11/17 16:29:23 since this is a small enough function and used onl
Leandro Graciá Gil 2011/11/17 22:02:45 Done.
4 if (chrome.extension.lastError) {
5 alert("Couldn't start speech input: " + chrome.extension.lastError.message);
6 }
7 }
8
9 chrome.browserAction.onClicked.addListener(function(tab) {
10 chrome.experimental.speechInput.isRecording(function (recording) {
11 if (!recording)
Satish 2011/11/17 16:29:23 use braces here?
Leandro Graciá Gil 2011/11/17 22:02:45 Done.
12 chrome.experimental.speechInput.start({}, checkStart);
Satish 2011/11/17 16:29:23 it may be useful if we change the browser action i
Satish 2011/11/17 16:29:23 is that empty dictionary {} required or can a null
Leandro Graciá Gil 2011/11/17 22:02:45 Done.
Leandro Graciá Gil 2011/11/17 22:02:45 It is required.
13 else
14 chrome.experimental.speechInput.stop();
15 });
16 });
17
18 chrome.experimental.speechInput.onError.addListener(function(error) {
19 alert("Speech input failed: " + error.code);
20 });
21
22 chrome.experimental.speechInput.onResult.addListener(function(result) {
23 alert(result.hypotheses[0].utterance);
24 });
25 </script>
26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698