summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorerikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 20:19:20 +0000
committererikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 20:19:20 +0000
commit2d8d923da42df61e9d65942945456d4b9304ef8e (patch)
tree21150546eca2423887f1cca5f9fe7a58ef08224a /chrome/test
parent9e0dfa8ae69f71441d62f725441f7075f791bd09 (diff)
downloadchromium_src-2d8d923da42df61e9d65942945456d4b9304ef8e.zip
chromium_src-2d8d923da42df61e9d65942945456d4b9304ef8e.tar.gz
chromium_src-2d8d923da42df61e9d65942945456d4b9304ef8e.tar.bz2
Add simple popup support to browser actions. This will create a popup HTML window that extends below a browser action button when the browser is clicked. When it loses focus, it is automatically dismissed.
BUG=23596 TEST=none Review URL: http://codereview.chromium.org/258011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rwxr-xr-xchrome/test/data/extensions/samples/set_page_color/icon.pngbin0 -> 3622 bytes
-rwxr-xr-xchrome/test/data/extensions/samples/set_page_color/manifest.json12
-rwxr-xr-xchrome/test/data/extensions/samples/set_page_color/popup.html45
3 files changed, 57 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/samples/set_page_color/icon.png b/chrome/test/data/extensions/samples/set_page_color/icon.png
new file mode 100755
index 0000000..1f1c906
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_page_color/icon.png
Binary files differ
diff --git a/chrome/test/data/extensions/samples/set_page_color/manifest.json b/chrome/test/data/extensions/samples/set_page_color/manifest.json
new file mode 100755
index 0000000..081681a
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_page_color/manifest.json
@@ -0,0 +1,12 @@
+{
+ "name": "A browser action with a popup that changes the page color.",
+ "version": "1.0",
+ "permissions": [
+ "tabs", "http://*/*"
+ ],
+ "browser_action": {
+ "name": "Set this page's color.",
+ "icons": ["icon.png"],
+ "popup": { "path": "popup.html", "height": 78 }
+ }
+} \ No newline at end of file
diff --git a/chrome/test/data/extensions/samples/set_page_color/popup.html b/chrome/test/data/extensions/samples/set_page_color/popup.html
new file mode 100755
index 0000000..e781b9b
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_page_color/popup.html
@@ -0,0 +1,45 @@
+<style>
+body {
+ overflow: hidden;
+ margin: 0px;
+ padding: 0px;
+ background: #cccccc;
+ border: 1px solid black;
+}
+div {
+ cursor: pointer;
+ text-align: center;
+ padding: 1px 3px;
+ font: menu;
+ width: 100px;
+}
+div:hover {
+ background: #aaaaaa;
+}
+#red {
+ border: 1px solid red;
+ color: red;
+}
+#blue {
+ border: 1px solid blue;
+ color: blue;
+}
+#green {
+ border: 1px solid green;
+ color: green;
+}
+#yellow {
+ border: 1px solid yellow;
+ color: yellow;
+}
+</style>
+<script>
+function click(color) {
+ chrome.tabs.executeScript(null,
+ {code:"document.body.bgColor='" + color.id + "'"});
+}
+</script>
+<div onclick="click(this)" id="red">red</div>
+<div onclick="click(this)" id="blue">blue</div>
+<div onclick="click(this)" id="green">green</div>
+<div onclick="click(this)" id="yellow">yellow</div>