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

Side by Side Diff: remoting/webapp/crd/js/apps_v2_migration.js

Issue 959963002: [Chromoting] Enable jscompile for webapp unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix key tester Created 5 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
« no previous file with comments | « remoting/webapp/crd/html/template_unittest.html ('k') | remoting/webapp/crd/js/oauth2.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * The current v1 web-app allows users to sign in as any user. Some users may 7 * The current v1 web-app allows users to sign in as any user. Some users may
8 * be signed in using a different account than their chrome profile. When these 8 * be signed in using a different account than their chrome profile. When these
9 * users upgrade to the v2 app, their host list will be empty and it is not 9 * users upgrade to the v2 app, their host list will be empty and it is not
10 * obvious why. remoting.AppsV2Migration shows a migration tip to the user to 10 * obvious why. remoting.AppsV2Migration shows a migration tip to the user to
11 * sign in to their previous accounts if necessary. 11 * sign in to their previous accounts if necessary.
12 */ 12 */
13 13
14 'use strict'; 14 'use strict';
15 15
16 /** @suppress {duplicate} */ 16 /** @suppress {duplicate} */
17 var remoting = remoting || {}; 17 var remoting = remoting || {};
18 18
19 (function() { 19 (function() {
20 20
21 // Storage key used for the migration settings. 21 // Storage key used for the migration settings.
22 var MIGRATION_KEY_ = 'remoting-v2-migration'; 22 var MIGRATION_KEY_ = 'remoting-v2-migration';
23 23
24 /** 24 /**
25 * @constructor
26 * @param {string} email 25 * @param {string} email
27 * @param {string} fullName 26 * @param {string} fullName
27 * @constructor
28 */ 28 */
29 remoting.MigrationSettings = function(email, fullName) { 29 remoting.MigrationSettings = function(email, fullName) {
30 this.email = email; 30 this.email = email;
31 this.fullName = fullName; 31 this.fullName = fullName;
32 }; 32 };
33 33
34 remoting.AppsV2Migration = function() {}; 34 remoting.AppsV2Migration = function() {};
35 35
36 /** 36 /**
37 * @return {Promise} A Promise object that would resolve to 37 * @return {Promise} A Promise object that would resolve to
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 }; 81 };
82 82
83 /** 83 /**
84 * Saves the email and full name of the current user as the migration settings 84 * Saves the email and full name of the current user as the migration settings
85 * in the v1 app. Clears the migration settings in the v2 app. 85 * in the v1 app. Clears the migration settings in the v2 app.
86 */ 86 */
87 remoting.AppsV2Migration.saveUserInfo = function() { 87 remoting.AppsV2Migration.saveUserInfo = function() {
88 if (base.isAppsV2()) { 88 if (base.isAppsV2()) {
89 chrome.storage.local.remove(MIGRATION_KEY_); 89 chrome.storage.local.remove(MIGRATION_KEY_);
90 } else { 90 } else {
91 /** 91 remoting.identity.getUserInfo().then(
92 * @param {string} email 92 /** @param {{email:string, name:string}} userInfo */
93 * @param {string} fullName 93 function(userInfo) {
94 */ 94 var preference = {};
95 remoting.identity.getUserInfo().then(function(userInfo) { 95 preference[MIGRATION_KEY_] =
96 var preference = {}; 96 new remoting.MigrationSettings(userInfo.email, userInfo.name);
97 preference[MIGRATION_KEY_] = 97 chrome.storage.local.set(preference);
98 new remoting.MigrationSettings(userInfo.email, userInfo.name); 98 }).catch(base.doNothing);
99 chrome.storage.local.set(preference);
100 }).catch(base.doNothing);
101 } 99 }
102 }; 100 };
103 101
104 }()); 102 }());
OLDNEW
« no previous file with comments | « remoting/webapp/crd/html/template_unittest.html ('k') | remoting/webapp/crd/js/oauth2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698