summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 22:13:14 +0000
committermkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 22:13:14 +0000
commit6c85633dad847cafc75efbe98b6580be6dfa5e02 (patch)
tree4519a8b3a0518295e3b0d7759142d7170d027832
parentc4989d9500805d7a086c904f66b4f45b0e31a0e5 (diff)
downloadchromium_src-6c85633dad847cafc75efbe98b6580be6dfa5e02.zip
chromium_src-6c85633dad847cafc75efbe98b6580be6dfa5e02.tar.gz
chromium_src-6c85633dad847cafc75efbe98b6580be6dfa5e02.tar.bz2
Updating the FX extension to manifest_version 2.
Also, rezips extenions from r119128 that I forgot at the time. :( BUG=111049 TEST= Review URL: https://chromiumcodereview.appspot.com/9285018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119129 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/docs/examples/extensions/fx.zipbin37956 -> 38276 bytes
-rw-r--r--chrome/common/extensions/docs/examples/extensions/fx/manifest.json7
-rw-r--r--chrome/common/extensions/docs/examples/extensions/fx/options.html58
-rw-r--r--chrome/common/extensions/docs/examples/extensions/fx/options.js59
-rw-r--r--chrome/common/extensions/docs/examples/extensions/oauth_contacts.zipbin68108 -> 68106 bytes
-rw-r--r--chrome/common/extensions/docs/examples/extensions/speak_selection.zipbin83118 -> 83110 bytes
-rw-r--r--chrome/common/extensions/docs/examples/extensions/talking_alarm_clock.zipbin1896077 -> 1896069 bytes
-rw-r--r--chrome/common/extensions/docs/samples.html2
-rw-r--r--chrome/common/extensions/docs/samples.json11
9 files changed, 73 insertions, 64 deletions
diff --git a/chrome/common/extensions/docs/examples/extensions/fx.zip b/chrome/common/extensions/docs/examples/extensions/fx.zip
index 908d77e..29c894a 100644
--- a/chrome/common/extensions/docs/examples/extensions/fx.zip
+++ b/chrome/common/extensions/docs/examples/extensions/fx.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/extensions/fx/manifest.json b/chrome/common/extensions/docs/examples/extensions/fx/manifest.json
index dd8384b..962c5ee 100644
--- a/chrome/common/extensions/docs/examples/extensions/fx/manifest.json
+++ b/chrome/common/extensions/docs/examples/extensions/fx/manifest.json
@@ -1,6 +1,6 @@
{
"name": "Chrome Sounds",
- "version": "1.1",
+ "version": "1.2",
"description": "Enjoy a more magical and immersive experience when browsing the web using the power of sound.",
"background": {
"scripts": ["bg.js"]
@@ -14,8 +14,9 @@
"https://*/*"
],
"content_scripts": [ {
- "matches": ["http://*/*", "https://*/*"],
+ "matches": ["http://*/*", "https://*/*"],
"js": ["content.js"],
"all_frames": true
- }]
+ }],
+ "manifest_version": 2
}
diff --git a/chrome/common/extensions/docs/examples/extensions/fx/options.html b/chrome/common/extensions/docs/examples/extensions/fx/options.html
index 8f5171c..2442482 100644
--- a/chrome/common/extensions/docs/examples/extensions/fx/options.html
+++ b/chrome/common/extensions/docs/examples/extensions/fx/options.html
@@ -14,63 +14,9 @@ body {
cursor: pointer;
}
</style>
-<script>
-
-function playSound(id) {
- console.log(id);
- chrome.extension.getBackgroundPage().playSound(id, false);
-}
-
-function stopSound(id) {
- chrome.extension.getBackgroundPage().stopSound(id);
-}
-
-function soundChanged(event) {
- var key = event.target.name;
- var checked = event.target.checked;
- if (checked) {
- localStorage.setItem(key, "enabled");
- playSound(event.target.name);
- } else {
- localStorage.setItem(key, "disabled");
- stopSound(event.target.name);
- }
-}
-
-function showSounds() {
- var sounds = document.getElementById("sounds");
- if (!localStorage.length) {
- sounds.innerText = "";
- return;
- }
- sounds.innerText = "Discovered sounds: (uncheck to disable)";
- var keys = new Array();
- for (var key in localStorage) {
- keys.push(key);
- console.log(key);
- }
- keys.sort();
- for (var index in keys) {
- var key = keys[index];
- var div = document.createElement("div");
- var check = document.createElement("input");
- check.type = "checkbox"
- check.name = key;
- check.checked = localStorage[key] == "enabled";
- check.onchange = soundChanged;
- div.appendChild(check);
- var text = document.createElement("span");
- text.id = key;
- text.innerText = key;
- text.className = "sound";
- text.onclick = function(event) { playSound(event.target.id); };
- div.appendChild(text);
- sounds.appendChild(div);
- }
-}
-</script>
+<script src="options.js"></script>
</head>
-<body onload="showSounds()" onFocus="showSounds()">
+<body>
<div id="sounds"></div>
<div id="attributions">
Sounds from:
diff --git a/chrome/common/extensions/docs/examples/extensions/fx/options.js b/chrome/common/extensions/docs/examples/extensions/fx/options.js
new file mode 100644
index 0000000..21d0afa
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/extensions/fx/options.js
@@ -0,0 +1,59 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function playSound(id) {
+ console.log(id);
+ chrome.extension.getBackgroundPage().playSound(id, false);
+}
+
+function stopSound(id) {
+ chrome.extension.getBackgroundPage().stopSound(id);
+}
+
+function soundChanged(event) {
+ var key = event.target.name;
+ var checked = event.target.checked;
+ if (checked) {
+ localStorage.setItem(key, "enabled");
+ playSound(event.target.name);
+ } else {
+ localStorage.setItem(key, "disabled");
+ stopSound(event.target.name);
+ }
+}
+
+function showSounds() {
+ var sounds = document.getElementById("sounds");
+ if (!localStorage.length) {
+ sounds.innerText = "";
+ return;
+ }
+ sounds.innerText = "Discovered sounds: (uncheck to disable)";
+ var keys = new Array();
+ for (var key in localStorage) {
+ keys.push(key);
+ console.log(key);
+ }
+ keys.sort();
+ for (var index in keys) {
+ var key = keys[index];
+ var div = document.createElement("div");
+ var check = document.createElement("input");
+ check.type = "checkbox"
+ check.name = key;
+ check.checked = localStorage[key] == "enabled";
+ check.onchange = soundChanged;
+ div.appendChild(check);
+ var text = document.createElement("span");
+ text.id = key;
+ text.innerText = key;
+ text.className = "sound";
+ text.onclick = function(event) { playSound(event.target.id); };
+ div.appendChild(text);
+ sounds.appendChild(div);
+ }
+}
+
+document.addEventListener('DOMContentLoaded', showSounds);
+document.addEventListener('focus', showSounds);
diff --git a/chrome/common/extensions/docs/examples/extensions/oauth_contacts.zip b/chrome/common/extensions/docs/examples/extensions/oauth_contacts.zip
index e519e1b..3d6a25d 100644
--- a/chrome/common/extensions/docs/examples/extensions/oauth_contacts.zip
+++ b/chrome/common/extensions/docs/examples/extensions/oauth_contacts.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/extensions/speak_selection.zip b/chrome/common/extensions/docs/examples/extensions/speak_selection.zip
index 3eeb0de..9a037c4 100644
--- a/chrome/common/extensions/docs/examples/extensions/speak_selection.zip
+++ b/chrome/common/extensions/docs/examples/extensions/speak_selection.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/extensions/talking_alarm_clock.zip b/chrome/common/extensions/docs/examples/extensions/talking_alarm_clock.zip
index cccfe93f..0809f27 100644
--- a/chrome/common/extensions/docs/examples/extensions/talking_alarm_clock.zip
+++ b/chrome/common/extensions/docs/examples/extensions/talking_alarm_clock.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/samples.html b/chrome/common/extensions/docs/samples.html
index f26befe..4db49c0 100644
--- a/chrome/common/extensions/docs/samples.html
+++ b/chrome/common/extensions/docs/samples.html
@@ -1115,6 +1115,8 @@
<code><a target="_blank" href="examples/extensions/fx/manifest.json">manifest.json</a></code>
</li><li>
<code><a target="_blank" href="examples/extensions/fx/options.html">options.html</a></code>
+ </li><li>
+ <code><a target="_blank" href="examples/extensions/fx/options.js">options.js</a></code>
</li>
</ul>
</div>
diff --git a/chrome/common/extensions/docs/samples.json b/chrome/common/extensions/docs/samples.json
index ed2a1f9..e0ad414 100644
--- a/chrome/common/extensions/docs/samples.json
+++ b/chrome/common/extensions/docs/samples.json
@@ -582,9 +582,10 @@
"bg.js",
"content.js",
"manifest.json",
- "options.html"
+ "options.html",
+ "options.js"
],
- "source_hash": "3079fc551f4fbdbcc1a224fcba31f22020711321",
+ "source_hash": "d611e0909f40d9131545755a3e2e342faf8b2657",
"zip_path": "examples\/extensions\/fx.zip"
},
{
@@ -2000,7 +2001,7 @@
"contacts.js",
"manifest.json"
],
- "source_hash": "760ff59a48b7f758e9a80a6485cc0eb0c092841a",
+ "source_hash": "3dc54318943ee65fca84c06c4e1249820a485cb1",
"zip_path": "examples\/extensions\/oauth_contacts.zip"
},
{
@@ -2108,7 +2109,7 @@
"options.js",
"tabs.js"
],
- "source_hash": "9ef5dd34467a74abe48382348ec1ecde65466fd1",
+ "source_hash": "6f2d935d106c39c574d219babcd793cba480dbc0",
"zip_path": "examples\/extensions\/speak_selection.zip"
},
{
@@ -2257,7 +2258,7 @@
"popup.html",
"popup.js"
],
- "source_hash": "d5b5b987c7ea37bd7ec1fe7048ff58b4aef2e99d",
+ "source_hash": "0f81e576201c057a090c921450482ba762aca919",
"zip_path": "examples\/extensions\/talking_alarm_clock.zip"
},
{