diff options
author | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-06 21:00:49 +0000 |
---|---|---|
committer | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-06 21:00:49 +0000 |
commit | dcac1fecd5957b6ac16b57b24b3efbd1356a438b (patch) | |
tree | 9eab4b278c7e81ca5fcda105a356ee05717a2d12 /chrome/common/extensions/docs/static | |
parent | 330d5722d6efc69242e037eeeedf8c13a16fd57a (diff) | |
download | chromium_src-dcac1fecd5957b6ac16b57b24b3efbd1356a438b.zip chromium_src-dcac1fecd5957b6ac16b57b24b3efbd1356a438b.tar.gz chromium_src-dcac1fecd5957b6ac16b57b24b3efbd1356a438b.tar.bz2 |
Initial Managed Mode extension API, supporting querying the setting and a stub for enabling the mode.
BUG=115447, 115448
TEST=covered by automated tests (browser_tests --gtest_filter=ExtensionApiTest.ManagedMode*)
Review URL: http://codereview.chromium.org/9566007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/static')
-rw-r--r-- | chrome/common/extensions/docs/static/experimental.managedMode.html | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/chrome/common/extensions/docs/static/experimental.managedMode.html b/chrome/common/extensions/docs/static/experimental.managedMode.html new file mode 100644 index 0000000..ec186b5 --- /dev/null +++ b/chrome/common/extensions/docs/static/experimental.managedMode.html @@ -0,0 +1,81 @@ +<div id="pageData-name" class="pageData">Managed Mode API</div> + +<!-- BEGIN AUTHORED CONTENT --> +<p id="classSummary"> + The <code>chrome.experimental.managedMode</code> module allows extensions to + request that the browser enter managed mode, as well as to query whether it + is currently in managed mode. +</p> + +<p class="note"> + <b>Note: </b>Extensions cannot request that the browser leave managed mode. + This must be done by the user from within the browser itself. +</p> + +<h2 id="manifest">Manifest</h2> +<p> + You must declare the "managedMode" and "experimental" permissions in your + extension's <a href="manifest.html">manifest</a> to use the API. For example: +</p> + +<pre>{ + "name": "My extension", + ... + <b>"permissions": [ + "experimental", + "managedMode" + ]</b>, + ... +}</pre> + +<h2 id="about">About Managed Mode</h2> + +<p> + Managed mode allows one person to manage the Chrome experience for another + person by pre-configuring and then locking a managed User profile. + + <span class="todo">For more information about Chrome's managed mode, see + <b>[TBD]</b>.</span> +</p> + +<h2 id="usage">Usage</h2> + +<p> + Querying managed mode is straightforward. Simply call <code>get()</code>, + providing a callback function to receive the result. For example: +</p> + +<pre>chrome.experimental.managedMode.get(function(details) { + if (details.value) + console.log('Managed mode is on.'); + else + console.log('Managed mode is off.'); +});</pre> + +<p> + Entering managed mode is a little bit more complex, because if the browser is + already in managed mode, trying to enter it again will have no effect. To + avoid confusing users, it's advisable to check whether your extension can + enter managed mode (i.e., if it is not already in effect), and visually + disable the functionality in your extension if not. You can optionally + provide a callback function to <code>enter()</code> to receive the result. + For example: +</p> + +<pre>chrome.experimental.managedMode.get(function(details) { + if (details.value) { + console.log("Managed mode is already in effect."); + } else { + chrome.experimental.managedMode.enter(function(result) { + if (chrome.extension.lastError === undefined) { + if (result.success) + console.log("Hooray, it worked!"); + else + console.log("Oops, the user changed her mind."); + } else { + console.log("Aw, snap!", chrome.extension.lastError); + } + }); + } +});</pre> +<!-- END AUTHORED CONTENT --> |