summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/extensions_ui.html
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 18:34:28 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 18:34:28 +0000
commit43919ac90f426c807da507d52c163972634c771e (patch)
tree29d4053f433b61e587fa532428cb3dc4b11823de /chrome/browser/resources/extensions_ui.html
parent29f192ded5a521a42ff1f93880e0787f2500d5a0 (diff)
downloadchromium_src-43919ac90f426c807da507d52c163972634c771e.zip
chromium_src-43919ac90f426c807da507d52c163972634c771e.tar.gz
chromium_src-43919ac90f426c807da507d52c163972634c771e.tar.bz2
Add concept of an options page to Extensions.
BUG=23801 TEST=Create an extension with an "options_page" entry in its manifest with a value the name of a html file in the extension dir. Load that extension and go to chrome://extensions, there should be an "Options" button that takes you to the page specified in the manifest. Review URL: http://codereview.chromium.org/271114 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/extensions_ui.html')
-rw-r--r--chrome/browser/resources/extensions_ui.html31
1 files changed, 22 insertions, 9 deletions
diff --git a/chrome/browser/resources/extensions_ui.html b/chrome/browser/resources/extensions_ui.html
index 99076f8..a228457 100644
--- a/chrome/browser/resources/extensions_ui.html
+++ b/chrome/browser/resources/extensions_ui.html
@@ -206,6 +206,7 @@ var extensionDataFormat = {
"description": "Extension long format description",
"version": "1.0.231",
"enabled": "true",
+ "options_url": "options.html",
"content_scripts": [
{
"js": ["script1_file1.js", "script1_file2.js"],
@@ -345,12 +346,19 @@ function handleUninstallExtension(node) {
}
/**
- * Utility function which asks the C++ to show a platform-specific file select
- * dialog, and fire |callback| with the |filePath| that resulted. |selectType|
- * can be either 'file' or 'folder'. |operation| can be 'load', 'packRoot',
- * or 'pem' which are signals to the C++ to do some operation-specific
- * configuration.
+ * Handles an 'options' button getting clicked.
*/
+function handleOptions(node) {
+ chrome.send('options', [node.extensionId]);
+}
+
+/**
+* Utility function which asks the C++ to show a platform-specific file select
+* dialog, and fire |callback| with the |filePath| that resulted. |selectType|
+* can be either 'file' or 'folder'. |operation| can be 'load', 'packRoot',
+* or 'pem' which are signals to the C++ to do some operation-specific
+* configuration.
+*/
function showFileDialog(selectType, operation, callback) {
handleFilePathSelected = function(filePath) {
callback(filePath);
@@ -387,7 +395,7 @@ function showPackDialog() {
/**
* Hides the pack dialog.
- */
+ */
function hidePackDialog() {
document.getElementById('dialogBackground').style.display="none"
}
@@ -438,7 +446,7 @@ function autoUpdate() {
<input type="text" id="extensionPathText">
</div>
<div>
- <input type="button" value="BROWSE"
+ <input type="button" value="BROWSE"
i18n-values="value:packDialogBrowse"
onclick="selectExtensionPath();">
</div>
@@ -451,7 +459,7 @@ function autoUpdate() {
<input type="text" id="privateKeyPath">
</div>
<div>
- <input type="button" value="BROWSE"
+ <input type="button" value="BROWSE"
i18n-values="value:packDialogBrowse"
onclick="selectPrivateKeyPath();">
</div>
@@ -463,7 +471,7 @@ function autoUpdate() {
<div>
<input type="button" value="Cancel" onclick="hidePackDialog();">
</div>
- </div>
+ </div>
</div>
</div>
</div>
@@ -524,6 +532,11 @@ function autoUpdate() {
jsvalues=".extensionId:id"
onclick="handleUninstallExtension(this)"
>Uninstall</button>
+ <button
+ jsdisplay="options_url"
+ jsvalues=".extensionId:id"
+ onclick="handleOptions(this)"
+ >Options</button>
</div>
</div>
</div>