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

Unified Diff: chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too 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/api_test/browser_action_tab_specific_state/background.html
diff --git a/chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html b/chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html
new file mode 100644
index 0000000000000000000000000000000000000000..7393c5d8c6ae8706934b1834378a6ba906d8e144
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<script>
+ var min = 1;
+ var max = 5;
+ var current = min;
+
+ // Called when the user clicks on the browser action.
+ chrome.browserAction.onClicked.addListener(function(tab) {
+ current++;
+ if (current > max)
+ current = min;
+
+ chrome.browserAction.setIcon({
+ path: "icon" + current + ".png",
+ tabId: tab.id
+ });
+ chrome.browserAction.setTitle({
+ title: "Showing icon " + current,
+ tabId: tab.id
+ });
+ chrome.browserAction.setBadgeText({
+ text: String(current),
+ tabId: tab.id
+ });
+ chrome.browserAction.setBadgeBackgroundColor({
+ color: [50*current,0,0,255],
+ tabId: tab.id
+ });
+
+ chrome.test.notifyPass();
+ });
+
+ chrome.test.notifyPass();
+</script>
+</head>
+</html>

Powered by Google App Engine
This is Rietveld 408576698