diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-22 01:43:24 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-22 01:43:24 +0000 |
commit | fec3e01108c3fcbc657da43d54699e2c66da2738 (patch) | |
tree | c319431a3c111b776b78e7bc3498a143977fbf1c | |
parent | fa967698b5e6cfe7feaff1db349869a56b98edc0 (diff) | |
download | chromium_src-fec3e01108c3fcbc657da43d54699e2c66da2738.zip chromium_src-fec3e01108c3fcbc657da43d54699e2c66da2738.tar.gz chromium_src-fec3e01108c3fcbc657da43d54699e2c66da2738.tar.bz2 |
Make power API extension set a default icon and title.
This makes the chrome.power "Keep Awake" example extension
define a default icon and title in its manifest file.
Otherwise, the extension works when it's first installed but
appears to die with "This extension has no action specified"
errors on subsequent runs.
(It also makes the extension add a click listener before
attempting to update the title and icon. Perhaps I was just
encountering a race, but making this change also seemed to
work around the problem.)
BUG=none
Review URL: https://codereview.chromium.org/12827011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189734 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/extensions/docs/examples/api/power/background.js | 2 | ||||
-rw-r--r-- | chrome/common/extensions/docs/examples/api/power/manifest.json | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/chrome/common/extensions/docs/examples/api/power/background.js b/chrome/common/extensions/docs/examples/api/power/background.js index e190777..edd18a7 100644 --- a/chrome/common/extensions/docs/examples/api/power/background.js +++ b/chrome/common/extensions/docs/examples/api/power/background.js @@ -109,5 +109,5 @@ function handleClicked() { } } -setLevel(getInitialLevel()); chrome.browserAction.onClicked.addListener(handleClicked); +setLevel(getInitialLevel()); diff --git a/chrome/common/extensions/docs/examples/api/power/manifest.json b/chrome/common/extensions/docs/examples/api/power/manifest.json index ccba84e..5fb20df 100644 --- a/chrome/common/extensions/docs/examples/api/power/manifest.json +++ b/chrome/common/extensions/docs/examples/api/power/manifest.json @@ -3,7 +3,7 @@ "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", - "version": "1.2", + "version": "1.4", "icons": { "16": "images/icon-16.png", "48": "images/icon-48.png", @@ -14,7 +14,13 @@ "experimental", "power" ], - "browser_action": {}, + "browser_action": { + "default_title": "__MSG_disabledTitle__", + "default_icon": { + "19": "images/night-19.png", + "38": "images/night-38.png" + } + }, "background": { "scripts": ["background.js"], "persistent": false |