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

Side by Side Diff: chrome/browser/resources/settings/people_page/sync_page.js

Issue 2495933002: [MD settings][cros accounts] Updates the accounts page according to the specs (Closed)
Patch Set: Addressed comment Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 (function() { 5 (function() {
6 6
7 /** 7 /**
8 * Names of the radio buttons which allow the user to choose their encryption 8 * Names of the radio buttons which allow the user to choose their encryption
9 * mechanism. 9 * mechanism.
10 * @enum {string} 10 * @enum {string}
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 }, 158 },
159 159
160 /** @override */ 160 /** @override */
161 detached: function() { 161 detached: function() {
162 if (settings.getCurrentRoute() == settings.Route.SYNC) 162 if (settings.getCurrentRoute() == settings.Route.SYNC)
163 this.onNavigateAwayFromPage_(); 163 this.onNavigateAwayFromPage_();
164 }, 164 },
165 165
166 /** @protected */ 166 /** @protected */
167 currentRouteChanged: function() { 167 currentRouteChanged: function() {
168 if (!this.isAttached)
169 return;
170
171 if (settings.getCurrentRoute() == settings.Route.SYNC) 168 if (settings.getCurrentRoute() == settings.Route.SYNC)
172 this.onNavigateToPage_(); 169 this.onNavigateToPage_();
173 else 170 else
174 this.onNavigateAwayFromPage_(); 171 this.onNavigateAwayFromPage_();
175 }, 172 },
176 173
177 /** 174 /**
178 * @param {!settings.PageStatus} expectedPageStatus 175 * @param {!settings.PageStatus} expectedPageStatus
179 * @return {boolean} 176 * @return {boolean}
180 * @private 177 * @private
181 */ 178 */
182 isStatus_: function(expectedPageStatus) { 179 isStatus_: function(expectedPageStatus) {
183 return expectedPageStatus == this.pageStatus_; 180 return expectedPageStatus == this.pageStatus_;
184 }, 181 },
185 182
186 /** @private */ 183 /** @private */
187 onNavigateToPage_: function() { 184 onNavigateToPage_: function() {
188 // The element is not ready for C++ interaction until it is attached.
189 assert(this.isAttached);
190 assert(settings.getCurrentRoute() == settings.Route.SYNC); 185 assert(settings.getCurrentRoute() == settings.Route.SYNC);
191 186
192 if (this.unloadCallback_) 187 if (this.unloadCallback_)
193 return; 188 return;
194 189
195 // Display loading page until the settings have been retrieved. 190 // Display loading page until the settings have been retrieved.
196 this.pageStatus_ = settings.PageStatus.SPINNER; 191 this.pageStatus_ = settings.PageStatus.SPINNER;
197 192
198 this.browserProxy_.didNavigateToSyncPage(); 193 this.browserProxy_.didNavigateToSyncPage();
199 194
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 416
422 this.$$('#passphraseInput').invalid = emptyPassphrase; 417 this.$$('#passphraseInput').invalid = emptyPassphrase;
423 this.$$('#passphraseConfirmationInput').invalid = 418 this.$$('#passphraseConfirmationInput').invalid =
424 !emptyPassphrase && mismatchedPassphrase; 419 !emptyPassphrase && mismatchedPassphrase;
425 420
426 return !emptyPassphrase && !mismatchedPassphrase; 421 return !emptyPassphrase && !mismatchedPassphrase;
427 }, 422 },
428 }); 423 });
429 424
430 })(); 425 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698