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

Unified Diff: chrome/test/data/extensions/samples/set_icon_path/background.html

Issue 269103: Implement chrome.browserAction.setIcon({path:...}); (Closed)
Patch Set: Created 11 years, 2 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:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/samples/set_icon_path/background.html
diff --git a/chrome/test/data/extensions/samples/set_icon_path/background.html b/chrome/test/data/extensions/samples/set_icon_path/background.html
new file mode 100755
index 0000000000000000000000000000000000000000..11aea5a8cf9a85c5d34a0c323713ce8c0c433b96
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/background.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<script>
+ var min = 1;
+ var max = 5;
+ var current = min;
+
+ function updateIcon() {
+ chrome.browserAction.setIcon({path:"icon" + current + ".png"});
+ current++;
+
+ if (current > max)
+ current = min;
+ }
+
+ chrome.browserAction.onClicked.addListener(updateIcon);
+ updateIcon();
+</script>
+</head>
+</html>

Powered by Google App Engine
This is Rietveld 408576698