Index: chrome/common/extensions/docs/static/experimental.managedMode.html |
=================================================================== |
--- chrome/common/extensions/docs/static/experimental.managedMode.html (revision 0) |
+++ chrome/common/extensions/docs/static/experimental.managedMode.html (revision 0) |
@@ -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 --> |
Property changes on: chrome\common\extensions\docs\static\experimental.managedMode.html |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |