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

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 11194047: Simplify onclick action code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove curly braces. Created 8 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('options', function() { 5 cr.define('options', function() {
6 var OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 var ArrayDataModel = cr.ui.ArrayDataModel; 7 var ArrayDataModel = cr.ui.ArrayDataModel;
8 var RepeatingButton = cr.ui.RepeatingButton; 8 var RepeatingButton = cr.ui.RepeatingButton;
9 9
10 // 10 //
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 // TODO(estade): can this just be textContent? 634 // TODO(estade): can this just be textContent?
635 $('sync-status-text').innerHTML = syncData.statusText; 635 $('sync-status-text').innerHTML = syncData.statusText;
636 var statusSet = syncData.statusText.length != 0; 636 var statusSet = syncData.statusText.length != 0;
637 $('sync-overview').hidden = statusSet; 637 $('sync-overview').hidden = statusSet;
638 $('sync-status').hidden = !statusSet; 638 $('sync-status').hidden = !statusSet;
639 639
640 $('sync-action-link').textContent = syncData.actionLinkText; 640 $('sync-action-link').textContent = syncData.actionLinkText;
641 $('sync-action-link').hidden = syncData.actionLinkText.length == 0; 641 $('sync-action-link').hidden = syncData.actionLinkText.length == 0;
642 $('sync-action-link').disabled = syncData.managed; 642 $('sync-action-link').disabled = syncData.managed;
643 643
644 if (cr.isChromeOS && syncData.hasError) { 644 // On Chrome OS, sign out the user and sign in again to get fresh
645 // On Chrome OS, sign out the user and sign in again to get fresh 645 // credentials on auth errors.
646 // credentials on auth errors. 646 $('sync-action-link').onclick = function(event) {
647 $('sync-action-link').onclick = function(event) { 647 if (cr.isChromeOS && syncData.hasError)
648 SyncSetupOverlay.doSignOutOnAuthError(); 648 SyncSetupOverlay.doSignOutOnAuthError();
649 }; 649 else
650 } else {
651 $('sync-action-link').onclick = function(event) {
652 SyncSetupOverlay.showErrorUI(); 650 SyncSetupOverlay.showErrorUI();
653 }; 651 };
654 }
655 652
656 if (syncData.hasError) 653 if (syncData.hasError)
657 $('sync-status').classList.add('sync-error'); 654 $('sync-status').classList.add('sync-error');
658 else 655 else
659 $('sync-status').classList.remove('sync-error'); 656 $('sync-status').classList.remove('sync-error');
660 657
661 $('customize-sync').disabled = syncData.hasUnrecoverableError; 658 $('customize-sync').disabled = syncData.hasUnrecoverableError;
662 // Move #enable-auto-login-checkbox to a different location on CrOS. 659 // Move #enable-auto-login-checkbox to a different location on CrOS.
663 if (cr.isChromeOs) { 660 if (cr.isChromeOs) {
664 $('sync-general').insertBefore($('sync-status').nextSibling, 661 $('sync-general').insertBefore($('sync-status').nextSibling,
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 BrowserOptions.getLoggedInUsername = function() { 1336 BrowserOptions.getLoggedInUsername = function() {
1340 return BrowserOptions.getInstance().username_; 1337 return BrowserOptions.getInstance().username_;
1341 }; 1338 };
1342 } 1339 }
1343 1340
1344 // Export 1341 // Export
1345 return { 1342 return {
1346 BrowserOptions: BrowserOptions 1343 BrowserOptions: BrowserOptions
1347 }; 1344 };
1348 }); 1345 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698