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

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

Issue 2230533002: Delete dead consumer enrollment code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
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.exportPath('options'); 5 cr.exportPath('options');
6 6
7 /** 7 /**
8 * @typedef {{actionLinkText: (string|undefined), 8 * @typedef {{actionLinkText: (string|undefined),
9 * childUser: (boolean|undefined), 9 * childUser: (boolean|undefined),
10 * hasError: (boolean|undefined), 10 * hasError: (boolean|undefined),
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 !loadTimeData.getBoolean('multiple_profiles'); 633 !loadTimeData.getBoolean('multiple_profiles');
634 } 634 }
635 635
636 // Network section. 636 // Network section.
637 if (!cr.isChromeOS) { 637 if (!cr.isChromeOS) {
638 $('proxiesConfigureButton').onclick = function(event) { 638 $('proxiesConfigureButton').onclick = function(event) {
639 chrome.send('showNetworkProxySettings'); 639 chrome.send('showNetworkProxySettings');
640 }; 640 };
641 } 641 }
642 642
643 // Device control section.
644 if (cr.isChromeOS &&
645 UIAccountTweaks.currentUserIsOwner() &&
646 loadTimeData.getBoolean('consumerManagementEnabled')) {
647 $('device-control-section').hidden = false;
648 $('consumer-management-button').onclick = function(event) {
649 PageManager.showPageByName('consumer-management-overlay');
650 };
651 }
652
653 // Easy Unlock section. 643 // Easy Unlock section.
654 if (loadTimeData.getBoolean('easyUnlockAllowed')) { 644 if (loadTimeData.getBoolean('easyUnlockAllowed')) {
655 $('easy-unlock-section').hidden = false; 645 $('easy-unlock-section').hidden = false;
656 $('easy-unlock-setup-button').onclick = function(event) { 646 $('easy-unlock-setup-button').onclick = function(event) {
657 chrome.send('launchEasyUnlockSetup'); 647 chrome.send('launchEasyUnlockSetup');
658 }; 648 };
659 $('easy-unlock-turn-off-button').onclick = function(event) { 649 $('easy-unlock-turn-off-button').onclick = function(event) {
660 PageManager.showPageByName('easyUnlockTurnOffOverlay'); 650 PageManager.showPageByName('easyUnlockTurnOffOverlay');
661 }; 651 };
662 } 652 }
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 /** 2375 /**
2386 * Returns username (canonical email) of the user logged in (ChromeOS only). 2376 * Returns username (canonical email) of the user logged in (ChromeOS only).
2387 * @return {string} user email. 2377 * @return {string} user email.
2388 */ 2378 */
2389 // TODO(jhawkins): Investigate the use case for this method. 2379 // TODO(jhawkins): Investigate the use case for this method.
2390 BrowserOptions.getLoggedInUsername = function() { 2380 BrowserOptions.getLoggedInUsername = function() {
2391 return BrowserOptions.getInstance().username_; 2381 return BrowserOptions.getInstance().username_;
2392 }; 2382 };
2393 2383
2394 /** 2384 /**
2395 * Shows different button text for each consumer management enrollment
2396 * status.
2397 * @enum {string} status Consumer management service status string.
2398 */
2399 BrowserOptions.setConsumerManagementStatus = function(status) {
2400 var button = $('consumer-management-button');
2401 if (status == 'StatusUnknown') {
2402 button.hidden = true;
2403 return;
2404 }
2405
2406 button.hidden = false;
2407 /** @type {string} */ var strId;
2408 switch (status) {
2409 case ConsumerManagementOverlay.Status.STATUS_UNENROLLED:
2410 strId = 'consumerManagementEnrollButton';
2411 button.disabled = false;
2412 ConsumerManagementOverlay.setStatus(status);
2413 break;
2414 case ConsumerManagementOverlay.Status.STATUS_ENROLLING:
2415 strId = 'consumerManagementEnrollingButton';
2416 button.disabled = true;
2417 break;
2418 case ConsumerManagementOverlay.Status.STATUS_ENROLLED:
2419 strId = 'consumerManagementUnenrollButton';
2420 button.disabled = false;
2421 ConsumerManagementOverlay.setStatus(status);
2422 break;
2423 case ConsumerManagementOverlay.Status.STATUS_UNENROLLING:
2424 strId = 'consumerManagementUnenrollingButton';
2425 button.disabled = true;
2426 break;
2427 }
2428 button.textContent = loadTimeData.getString(strId);
2429 };
2430
2431 /**
2432 * Shows Android Apps settings when they are available. 2385 * Shows Android Apps settings when they are available.
2433 * (Chrome OS only). 2386 * (Chrome OS only).
2434 */ 2387 */
2435 BrowserOptions.showAndroidAppsSection = function(isArcEnabled) { 2388 BrowserOptions.showAndroidAppsSection = function(isArcEnabled) {
2436 var section = $('android-apps-section'); 2389 var section = $('android-apps-section');
2437 if (!section) 2390 if (!section)
2438 return; 2391 return;
2439 2392
2440 section.hidden = false; 2393 section.hidden = false;
2441 }; 2394 };
2442 2395
2443 /** 2396 /**
2444 * Shows/hides Android Settings app section. 2397 * Shows/hides Android Settings app section.
2445 * (Chrome OS only). 2398 * (Chrome OS only).
2446 */ 2399 */
2447 BrowserOptions.setAndroidAppsSettingsVisibility = function(isVisible) { 2400 BrowserOptions.setAndroidAppsSettingsVisibility = function(isVisible) {
2448 var settings = $('android-apps-settings'); 2401 var settings = $('android-apps-settings');
2449 if (!settings) 2402 if (!settings)
2450 return; 2403 return;
2451 2404
2452 settings.hidden = !isVisible; 2405 settings.hidden = !isVisible;
2453 }; 2406 };
2454 } 2407 }
2455 2408
2456 // Export 2409 // Export
2457 return { 2410 return {
2458 BrowserOptions: BrowserOptions 2411 BrowserOptions: BrowserOptions
2459 }; 2412 };
2460 }); 2413 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698