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

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

Issue 8698003: Adding CSP to Speech Input API sample. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: License. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/api/speechInput/basic/background.html
diff --git a/chrome/common/extensions/docs/examples/api/speechInput/basic/background.html b/chrome/common/extensions/docs/examples/api/speechInput/basic/background.html
index 34e71518abb49119b81f74b2d771f5d6214de6d0..713f0c32bcf452d0a1043be1a923e3fa3399200b 100644
--- a/chrome/common/extensions/docs/examples/api/speechInput/basic/background.html
+++ b/chrome/common/extensions/docs/examples/api/speechInput/basic/background.html
@@ -1,40 +1,9 @@
+<!doctype html>
<html>
-<script>
-function setStartIcon() {
- chrome.browserAction.setIcon({ path: "start.png" });
-}
-
-function setStopIcon() {
- chrome.browserAction.setIcon({ path: "stop.png" });
-}
-
-chrome.browserAction.onClicked.addListener(function(tab) {
- chrome.experimental.speechInput.isRecording(function(recording) {
- if (!recording) {
- chrome.experimental.speechInput.start({}, function() {
- if (chrome.extension.lastError) {
- alert("Couldn't start speech input: " + chrome.extension.lastError.message);
- setStartIcon();
- } else {
- setStopIcon();
- }
- });
- } else {
- chrome.experimental.speechInput.stop(function() {
- setStartIcon();
- });
- }
- });
-});
-
-chrome.experimental.speechInput.onError.addListener(function(error) {
- alert("Speech input failed: " + error.code);
- setStartIcon();
-});
-
-chrome.experimental.speechInput.onResult.addListener(function(result) {
- alert(result.hypotheses[0].utterance);
- setStartIcon();
-});
-</script>
+ <head>
+ <title>Speech Input API Background Page</title>
+ </head>
+ <body>
+ <script src="background.js"></script>
+ </body>
</html>

Powered by Google App Engine
This is Rietveld 408576698