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

Side by Side Diff: chrome/common/extensions/docs/examples/api/screenlockPrivate/weblocker/bg.js

Issue 60583003: The chrome.screenlockPrivate API allows select apps to control the ChromeOS ScreenLocker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up apitest.cc Created 7 years, 1 month 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
OLDNEW
(Empty)
1 function webunlock() {
2 var xhr = new XMLHttpRequest();
3 xhr.onreadystatechange = function() {
4 if (xhr.readyState != 4) return;
5 window.setTimeout(webunlock, 2000);
6 if (xhr.status != 200) return;
7 var should_be_locked = (xhr.responseText == 'LOCK');
8 chrome.screenlockPrivate.getLocked(function(is_locked) {
9 console.log('should=' + should_be_locked + ' is=' + is_locked);
10 if (is_locked != should_be_locked) {
11 chrome.screenlockPrivate.setLocked(should_be_locked);
12 }
13 });
14 }
15 xhr.open('get', 'http://scrap.mtv.corp.google.com:54329/value', true);
Matt Perry 2013/11/13 01:01:14 I wouldn't check this in with a reference to a cor
Matt Perry 2013/11/13 01:01:14 Do you need this example now that there's an API t
benjhayden 2013/11/13 17:17:51 Done.
benjhayden 2013/11/13 17:17:51 Done.
16 xhr.send();
17 }
18 webunlock();
19
20 chrome.screenlockPrivate.onChanged.addListener(function(locked) {
21 console.log('The screen is now ' + (locked ? '' : 'un') + 'locked.');
22 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698