OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var remoting = {}; | 5 var remoting = {}; |
6 | 6 |
7 function setItem(key, value) { | 7 function setItem(key, value) { |
8 window.localStorage.setItem(key, value); | 8 window.localStorage.setItem(key, value); |
9 } | 9 } |
10 | 10 |
11 function getItem(key, defaultValue) { | 11 function getItem(key, defaultValue) { |
12 var result = window.localStorage.getItem(key); | 12 var result = window.localStorage.getItem(key); |
13 return (result != null) ? result : defaultValue; | 13 return (result != null) ? result : defaultValue; |
14 } | 14 } |
15 | 15 |
16 function removeItem(key) { | 16 function removeItem(key) { |
17 window.localStorage.removeItem(key); | 17 window.localStorage.removeItem(key); |
18 } | 18 } |
19 | 19 |
20 function clearAll() { | 20 function clearAll() { |
21 window.localStorage.clear(); | 21 window.localStorage.clear(); |
22 } | 22 } |
23 | |
24 var oauth = ChromeExOAuth.initBackgroundPage({ | |
25 'request_url': 'https://www.google.com/accounts/OAuthGetRequestToken', | |
26 'authorize_url': 'https://www.google.com/accounts/OAuthAuthorizeToken', | |
27 'access_url': 'https://www.google.com/accounts/OAuthGetAccessToken', | |
28 'consumer_key': 'anonymous', | |
29 'consumer_secret': 'anonymous', | |
30 'scope': 'https://www.googleapis.com/auth/chromoting', | |
31 'app_name': 'Remoting WebApp' | |
32 }); | |
OLD | NEW |