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

Side by Side Diff: chrome/common/extensions/docs/experimental.managedMode.html

Issue 9566007: Initial Managed Mode extension API, supporting querying the setting and a stub for enabling the mod… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Updated checkout again Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note:
2 1) The <head> information in this page is significant, should be uniform
3 across api docs and should be edited only with knowledge of the
4 templating mechanism.
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a
6 browser, it will be re-generated from the template, json schema and
7 authored overview content.
8 4) The <body>.innerHTML is also generated by an offline step so that this
9 page may easily be indexed by search engines.
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head>
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css">
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print">
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla te_compiled.js">
15 </script>
16 <script type="text/javascript" src="js/api_page_generator.js"></script>
17 <script type="text/javascript" src="js/bootstrap.js"></script>
18 <script type="text/javascript" src="js/sidebar.js"></script>
19 <meta name="description" content="Documentation for the chrome.experimental.ma nagedMode module, which is part of the Google Chrome extension APIs."><title>Ma naged Mode API - Google Chrome Extensions - Google Code</title></head>
20 <body> <div id="devModeWarning" class="displayModeWarning">
21 You are viewing extension docs in chrome via the 'file:' scheme: are you exp ecting to see local changes when you refresh? You'll need run chrome with --allo w-file-access-from-files.
22 </div>
23 <div id="branchWarning" class="displayModeWarning">
24 <span>WARNING: This is the <span id="branchName">BETA</span> documentation.
25 It may not work with the stable release of Chrome.</span>
26 <select id="branchChooser">
27 <option>Choose a different version...
28 </option><option value="">Stable
29 </option><option value="beta">Beta
30 </option><option value="dev">Dev
31 </option><option value="trunk">Trunk
32 </option></select>
33 </div>
34 <div id="unofficialWarning" class="displayModeWarning">
35 <span>WARNING: This is unofficial documentation. It may not work with the
36 current release of Chrome.</span>
37 <button id="goToOfficialDocs">Go to the official docs</button>
38 </div>
39 <div id="gc-container" class="labs">
40 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION -->
41 <!-- In particular, sub-templates that recurse, must be used by allowing
42 jstemplate to make a copy of the template in this section which
43 are not operated on by way of the jsskip="true" -->
44 <!-- /SUBTEMPLATES -->
45 <a id="top"></a>
46 <div id="skipto">
47 <a href="#gc-pagecontent">Skip to page content</a>
48 <a href="#gc-toc">Skip to main navigation</a>
49 </div>
50 <!-- API HEADER -->
51 <table id="header" width="100%" cellspacing="0" border="0">
52 <tbody><tr>
53 <td valign="middle"><a href="http://code.google.com/"><img src="images/c ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border: 0; margin:0;"></a></td>
54 <td valign="middle" width="100%" style="padding-left:0.6em;">
55 <form action="http://www.google.com/cse" id="cse" style="margin-top:0. 5em">
56 <div id="gsc-search-box">
57 <input type="hidden" name="cx" value="002967670403910741006:61_cvz fqtno">
58 <input type="hidden" name="ie" value="UTF-8">
59 <input type="text" name="q" value="" size="55">
60 <input class="gsc-search-button" type="submit" name="sa" value="Se arch">
61 <br>
62 <span class="greytext">e.g. "page action" or "tabs"</span>
63 </div>
64 </form>
65 <script type="text/javascript" src="https://www.google.com/jsapi"></sc ript>
66 <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
67 <script type="text/javascript" src="https://www.google.com/coop/cse/t1 3n?form=cse&amp;t13n_langs=en"></script>
68 <script type="text/javascript" src="https://www.google.com/coop/cse/br and?form=cse&amp;lang=en"></script>
69 </td>
70 </tr>
71 </tbody></table>
72 <div id="codesiteContent" class="">
73 <a id="gc-topnav-anchor"></a>
74 <div id="gc-topnav">
75 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab s</a>)</h1>
76 <ul id="home" class="gc-topnav-tabs">
77 <li id="home_link">
78 <a href="index.html" title="Google Chrome Extensions home page">Home </a>
79 </li>
80 <li id="docs_link">
81 <a href="docs.html" title="Official Google Chrome Extensions documen tation">Docs</a>
82 </li>
83 <li id="faq_link">
84 <a href="faq.html" title="Answers to frequently asked questions abou t Google Chrome Extensions">FAQ</a>
85 </li>
86 <li id="samples_link">
87 <a href="samples.html" title="Sample extensions (with source code)"> Samples</a>
88 </li>
89 <li id="group_link">
90 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte nsions" title="Google Chrome Extensions developer forum">Group</a>
91 </li>
92 <li id="so_link">
93 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a>
94 </li>
95 </ul>
96 </div> <!-- end gc-topnav -->
97 <div class="g-section g-tpl-170">
98 <!-- SIDENAV -->
99 <div class="g-unit g-first" id="gc-toc">
100 <ul>
101 <li><a href="getstarted.html">Getting Started</a></li>
102 <li><a href="overview.html">Overview</a></li>
103 <li><a href="whats_new.html">What's New?</a></li>
104 <li><h2><a href="devguide.html">Developer's Guide</a></h2>
105 <ul>
106 <li>Browser UI
107 <ul>
108 <li><a href="browserAction.html">Browser Actions</a></li>
109 <li><a href="contextMenus.html">Context Menus</a></li>
110 <li><a href="notifications.html">Desktop Notifications</a></li >
111 <li><a href="omnibox.html">Omnibox</a></li>
112 <li><a href="options.html">Options Pages</a></li>
113 <li><a href="override.html">Override Pages</a></li>
114 <li><a href="pageAction.html">Page Actions</a></li>
115 </ul>
116 </li>
117 <li>Browser Interaction
118 <ul>
119 <li><a href="bookmarks.html">Bookmarks</a></li>
120 <li><a href="cookies.html">Cookies</a></li>
121 <li><a href="devtools.html">Developer Tools</a></li>
122 <li><a href="events.html">Events</a></li>
123 <li><a href="history.html">History</a></li>
124 <li><a href="management.html">Management</a></li>
125 <li><a href="tabs.html">Tabs</a></li>
126 <li><a href="windows.html">Windows</a></li>
127 </ul>
128 </li>
129 <li>Implementation
130 <ul>
131 <li><a href="a11y.html">Accessibility</a></li>
132 <li><a href="background_pages.html">Background Pages</a></li>
133 <li><a href="content_scripts.html">Content Scripts</a></li>
134 <li><a href="xhr.html">Cross-Origin XHR</a></li>
135 <li><a href="i18n.html">Internationalization</a></li>
136 <li><a href="messaging.html">Message Passing</a></li>
137 <li><a href="permissions.html">Optional Permissions</a></li>
138 <li><a href="npapi.html">NPAPI Plugins</a></li>
139 </ul>
140 </li>
141 <li>Finishing
142 <ul>
143 <li><a href="hosting.html">Hosting</a></li>
144 <li><a href="external_extensions.html">Other Deployment Option s</a></li>
145 </ul>
146 </li>
147 </ul>
148 </li>
149 <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
150 <li><h2><a href="tutorials.html">Tutorials</a></h2>
151 <ul>
152 <li><a href="tut_debugging.html">Debugging</a></li>
153 <li><a href="tut_analytics.html">Google Analytics</a></li>
154 <li><a href="tut_oauth.html">OAuth</a></li>
155 </ul>
156 </li>
157 <li><h2>Reference</h2>
158 <ul>
159 <li>Formats
160 <ul>
161 <li><a href="manifest.html">Manifest Files</a></li>
162 <li><a href="match_patterns.html">Match Patterns</a></li>
163 </ul>
164 </li>
165 <li><a href="permission_warnings.html">Permission Warnings</a></li >
166 <li><a href="api_index.html">chrome.* APIs</a></li>
167 <li><a href="api_other.html">Other APIs</a></li>
168 </ul>
169 </li>
170 <li><h2><a href="samples.html">Samples</a></h2></li>
171 <div class="line"> </div>
172 <li><h2>More</h2>
173 <ul>
174 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm l">Chrome Web Store</a></li>
175 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu ide.html">Hosted Apps</a></li>
176 <li><a href="themes.html">Themes</a></li>
177 </ul>
178 </li>
179 </ul>
180 </div>
181 <script>
182 initToggles();
183 </script>
184 <div class="g-unit" id="gc-pagecontent">
185 <div id="pageTitle">
186 <h1 class="page_title">Managed Mode API</h1>
187 </div>
188 <!-- TABLE OF CONTENTS -->
189 <div id="toc">
190 <h2>Contents</h2>
191 <ol>
192 <li>
193 <a href="#manifest">Manifest</a>
194 <ol>
195 </ol>
196 </li><li>
197 <a href="#about">About Managed Mode</a>
198 <ol>
199 </ol>
200 </li><li>
201 <a href="#usage">Usage</a>
202 <ol>
203 </ol>
204 </li>
205 <li>
206 <a href="#apiReference">API reference: chrome.experimental.manag edMode</a>
207 <ol>
208 <li>
209 <a href="#global-methods">Methods</a>
210 <ol>
211 <li>
212 <a href="#method-enter">enter</a>
213 </li><li>
214 <a href="#method-get">get</a>
215 </li>
216 </ol>
217 </li>
218 </ol>
219 </li>
220 </ol>
221 </div>
222 <!-- /TABLE OF CONTENTS -->
223 <!-- Standard content lead-in for experimental API pages -->
224 <!-- STATIC CONTENT PLACEHOLDER -->
225 <div id="static"><div id="pageData-name" class="pageData">Managed Mode A PI</div>
226 <!-- BEGIN AUTHORED CONTENT -->
227 <p id="classSummary">
228 The <code>chrome.experimental.managedMode</code> module allows extensions to
229 request that the browser enter managed mode, as well as to query whether it
230 is currently in managed mode.
231 </p>
232 <p class="note">
233 <b>Note: </b>Extensions cannot request that the browser leave managed mode.
234 This must be done by the user from within the browser itself.
235 </p>
236 <h2 id="manifest">Manifest</h2>
237 <p>
238 You must declare the "managedMode" and "experimental" permissions in your
239 extension's <a href="manifest.html">manifest</a> to use the API. For example:
240 </p>
241 <pre>{
242 "name": "My extension",
243 ...
244 <b>"permissions": [
245 "experimental",
246 "managedMode"
247 ]</b>,
248 ...
249 }</pre>
250 <h2 id="about">About Managed Mode</h2>
251 <p>
252 Managed mode allows one person to manage the Chrome experience for another
253 person by pre-configuring and then locking a managed User profile.
254 <span class="todo">For more information about Chrome's managed mode, see
255 <b>[TBD]</b>.</span>
256 </p>
257 <h2 id="usage">Usage</h2>
258 <p>
259 Querying managed mode is straightforward. Simply call <code>get()</code>,
260 providing a callback function to receive the result. For example:
261 </p>
262 <pre>chrome.experimental.managedMode.get(function(details) {
263 if (details.value)
264 console.log('Managed mode is on.');
265 else
266 console.log('Managed mode is off.');
267 });</pre>
268 <p>
269 Entering managed mode is a little bit more complex, because if the browser is
270 already in managed mode, trying to enter it again will have no effect. To
271 avoid confusing users, it's advisable to check whether your extension can
272 enter managed mode (i.e., if it is not already in effect), and visually
273 disable the functionality in your extension if not. You can optionally
274 provide a callback function to <code>enter()</code> to receive the result.
275 For example:
276 </p>
277 <pre>chrome.experimental.managedMode.get(function(details) {
278 if (details.value) {
279 console.log("Managed mode is already in effect.");
280 } else {
281 chrome.experimental.managedMode.enter(function(result) {
282 if (chrome.extension.lastError === undefined) {
283 if (result.success)
284 console.log("Hooray, it worked!");
285 else
286 console.log("Oops, the user changed her mind.");
287 } else {
288 console.log("Aw, snap!", chrome.extension.lastError);
289 }
290 });
291 }
292 });</pre>
293 <!-- END AUTHORED CONTENT -->
294 </div>
295 <!-- API PAGE -->
296 <div class="apiPage">
297 <a name="apiReference"></a>
298 <h2>API reference: chrome.experimental.managedMode</h2>
299 <!-- PROPERTIES -->
300 <!-- /apiGroup -->
301 <!-- METHODS -->
302 <div id="methodsTemplate" class="apiGroup">
303 <a name="global-methods"></a>
304 <h3>Methods</h3>
305 <!-- iterates over all functions -->
306 <div class="apiItem">
307 <a name="method-enter"></a> <!-- method-anchor -->
308 <h4>enter</h4>
309 <div class="summary">
310 <!-- Note: intentionally longer 80 columns -->
311 <span>chrome.experimental.managedMode.enter</span>(<span class ="optional"><span>function</span>
312 <var><span>callback</span></var></span>)</div>
313 <div class="description">
314 <p>Shows a confirmation dialog, then puts the browser into manag ed mode. The callback parameter will be true if managed mode was entered success fully, false if the user cancelled the confirmation. If managed mode is already on, trying to enter it again will have no effect.</p>
315 <!-- PARAMETERS -->
316 <h4>Parameters</h4>
317 <dl>
318 <div>
319 <div>
320 <dt>
321 <var>callback</var>
322 <em>
323 <!-- TYPE -->
324 <div style="display:inline">
325 (
326 <span class="optional">optional</span>
327 <span id="typeTemplate">
328 <span>
329 <span>function</span>
330 </span>
331 </span>
332 )
333 </div>
334 </em>
335 </dt>
336 <dd class="todo">
337 Undocumented.
338 </dd>
339 <!-- OBJECT PROPERTIES -->
340 <!-- OBJECT METHODS -->
341 <!-- OBJECT EVENT FIELDS -->
342 <!-- FUNCTION PARAMETERS -->
343 </div>
344 </div>
345 </dl>
346 <!-- RETURNS -->
347 <dl>
348 </dl>
349 <!-- CALLBACK -->
350 <div>
351 <div>
352 <h4>Callback function</h4>
353 <p>
354 If you specify the <em>callback</em> parameter, it should
355 specify a function that looks like this:
356 </p>
357 <!-- Note: intentionally longer 80 columns -->
358 <pre>function(<span>object result</span>) <span class="subdued ">{...}</span>;</pre>
359 <dl>
360 <div>
361 <div>
362 <dt>
363 <var>result</var>
364 <em>
365 <!-- TYPE -->
366 <div style="display:inline">
367 (
368 <span id="typeTemplate">
369 <span>
370 <span>object</span>
371 </span>
372 </span>
373 )
374 </div>
375 </em>
376 </dt>
377 <dd>The result of the attempt to enter managed mode.</dd>
378 <!-- OBJECT PROPERTIES -->
379 <dd>
380 <dl>
381 <div>
382 <div>
383 <dt>
384 <var>success</var>
385 <em>
386 <!-- TYPE -->
387 <div style="display:inline">
388 (
389 <span id="typeTemplate">
390 <span>
391 <span>boolean</span>
392 </span>
393 </span>
394 )
395 </div>
396 </em>
397 </dt>
398 <dd>True if managed mode was entered successfully, false if the user c ancelled the confirmation.</dd>
399 <!-- OBJECT PROPERTIES -->
400 <!-- OBJECT METHODS -->
401 <!-- OBJECT EVENT FIELDS -->
402 <!-- FUNCTION PARAMETERS -->
403 </div>
404 </div>
405 </dl>
406 </dd>
407 <!-- OBJECT METHODS -->
408 <!-- OBJECT EVENT FIELDS -->
409 <!-- FUNCTION PARAMETERS -->
410 </div>
411 </div>
412 </dl>
413 </div>
414 </div>
415 <!-- MIN_VERSION -->
416 </div> <!-- /description -->
417 </div><div class="apiItem">
418 <a name="method-get"></a> <!-- method-anchor -->
419 <h4>get</h4>
420 <div class="summary">
421 <!-- Note: intentionally longer 80 columns -->
422 <span>chrome.experimental.managedMode.get</span>(<span class=" null"><span>function</span>
423 <var><span>callback</span></var></span>)</div>
424 <div class="description">
425 <p>Gets the value of the setting describing whether managed mode is in effect.</p>
426 <!-- PARAMETERS -->
427 <h4>Parameters</h4>
428 <dl>
429 <div>
430 <div>
431 <dt>
432 <var>callback</var>
433 <em>
434 <!-- TYPE -->
435 <div style="display:inline">
436 (
437 <span id="typeTemplate">
438 <span>
439 <span>function</span>
440 </span>
441 </span>
442 )
443 </div>
444 </em>
445 </dt>
446 <dd class="todo">
447 Undocumented.
448 </dd>
449 <!-- OBJECT PROPERTIES -->
450 <!-- OBJECT METHODS -->
451 <!-- OBJECT EVENT FIELDS -->
452 <!-- FUNCTION PARAMETERS -->
453 </div>
454 </div>
455 </dl>
456 <!-- RETURNS -->
457 <dl>
458 </dl>
459 <!-- CALLBACK -->
460 <div>
461 <div>
462 <h4>Callback function</h4>
463 <p>
464 The callback <em>parameter</em> should specify a function
465 that looks like this:
466 </p>
467 <!-- Note: intentionally longer 80 columns -->
468 <pre>function(<span>object details</span>) <span class="subdue d">{...}</span>;</pre>
469 <dl>
470 <div>
471 <div>
472 <dt>
473 <var>details</var>
474 <em>
475 <!-- TYPE -->
476 <div style="display:inline">
477 (
478 <span id="typeTemplate">
479 <span>
480 <span>object</span>
481 </span>
482 </span>
483 )
484 </div>
485 </em>
486 </dt>
487 <dd>Details of the currently effective value.</dd>
488 <!-- OBJECT PROPERTIES -->
489 <dd>
490 <dl>
491 <div>
492 <div>
493 <dt>
494 <var>value</var>
495 <em>
496 <!-- TYPE -->
497 <div style="display:inline">
498 (
499 <span id="typeTemplate">
500 <span>
501 <span>boolean</span>
502 </span>
503 </span>
504 )
505 </div>
506 </em>
507 </dt>
508 <dd>The value of the setting.</dd>
509 <!-- OBJECT PROPERTIES -->
510 <!-- OBJECT METHODS -->
511 <!-- OBJECT EVENT FIELDS -->
512 <!-- FUNCTION PARAMETERS -->
513 </div>
514 </div>
515 </dl>
516 </dd>
517 <!-- OBJECT METHODS -->
518 <!-- OBJECT EVENT FIELDS -->
519 <!-- FUNCTION PARAMETERS -->
520 </div>
521 </div>
522 </dl>
523 </div>
524 </div>
525 <!-- MIN_VERSION -->
526 </div> <!-- /description -->
527 </div> <!-- /apiItem -->
528 </div> <!-- /apiGroup -->
529 <!-- EVENTS -->
530 <!-- /apiGroup -->
531 <!-- TYPES -->
532 <!-- /apiGroup -->
533 </div> <!-- /apiPage -->
534 </div> <!-- /gc-pagecontent -->
535 </div> <!-- /g-section -->
536 </div> <!-- /codesiteContent -->
537 <div id="gc-footer" --="">
538 <div class="text">
539 <p>
540 Except as otherwise <a href="http://code.google.com/policies.html#restrictions ">noted</a>,
541 the content of this page is licensed under the <a rel="license" href="http://c reativecommons.org/licenses/by/3.0/">Creative Commons
542 Attribution 3.0 License</a>, and code samples are licensed under the
543 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic ense</a>.
544 </p>
545 <p>
546 ©2011 Google
547 </p>
548 <!-- begin analytics -->
549 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
550 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc ript>
551 <script type="text/javascript">
552 // chrome doc tracking
553 try {
554 var engdocs = _gat._getTracker("YT-10763712-2");
555 engdocs._trackPageview();
556 } catch(err) {}
557 // code.google.com site-wide tracking
558 try {
559 _uacct="UA-18071-1";
560 _uanchor=1;
561 _uff=0;
562 urchinTracker();
563 }
564 catch(e) {/* urchinTracker not available. */}
565 </script>
566 <!-- end analytics -->
567 </div>
568 </div> <!-- /gc-footer -->
569 </div> <!-- /gc-container -->
570 </body></html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/experimental.html ('k') | chrome/common/extensions/docs/js/api_page_generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698