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

Unified Diff: chrome/test/data/extensions/api_test/browser_action/default_persistence/background.js

Issue 186013003: Persist browseraction properties across restarts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jeffrey's Created 6 years, 10 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/default_persistence/background.js
diff --git a/chrome/test/data/extensions/api_test/browser_action/default_persistence/background.js b/chrome/test/data/extensions/api_test/browser_action/default_persistence/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..63e66eb817447187626bfc230ef475a39777f58a
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/browser_action/default_persistence/background.js
@@ -0,0 +1,10 @@
+// Set a background color for the badge at OnInstalled().
+chrome.runtime.onInstalled.addListener(function() {
+ chrome.browserAction.setBadgeBackgroundColor({color: [0, 0, 255, 255]});
+});
+
+// Every startup, change the badge text, but not the background color (which
+// should persist at the blue we set originally).
+chrome.runtime.onStartup.addListener(function() {
+ chrome.browserAction.setBadgeText({text: 'Hello'});
+});

Powered by Google App Engine
This is Rietveld 408576698