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

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

Issue 2100803004: Options: Fix android app settings visibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « 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.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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 el.dataset.extensionId.length; 825 el.dataset.extensionId.length;
826 }); 826 });
827 if (button) 827 if (button)
828 chrome.send('disableExtension', [button.dataset.extensionId]); 828 chrome.send('disableExtension', [button.dataset.extensionId]);
829 }); 829 });
830 830
831 // Setup ARC section. 831 // Setup ARC section.
832 if (cr.isChromeOS) { 832 if (cr.isChromeOS) {
833 $('android-apps-settings-label').innerHTML = 833 $('android-apps-settings-label').innerHTML =
834 loadTimeData.getString('androidAppsSettingsLabel'); 834 loadTimeData.getString('androidAppsSettingsLabel');
835 $('android-apps-enabled').addEventListener('change', function(e) { 835 Preferences.getInstance().addEventListener('arc.enabled', function(e) {
836 var settings = $('android-apps-settings'); 836 var settings = $('android-apps-settings');
837 if (!settings) 837 // Only change settings visibility on committed settings changes.
838 if (!settings || e.value.uncommitted)
838 return; 839 return;
839 settings.hidden = !$('android-apps-enabled').checked; 840 settings.hidden = !e.value.value;
840 }); 841 });
842
841 $('android-apps-settings-link').addEventListener('click', function(e) { 843 $('android-apps-settings-link').addEventListener('click', function(e) {
842 chrome.send('showAndroidAppsSettings'); 844 chrome.send('showAndroidAppsSettings');
843 }); 845 });
844 } 846 }
845 }, 847 },
846 848
847 /** @override */ 849 /** @override */
848 didShowPage: function() { 850 didShowPage: function() {
849 $('search-field').focus(); 851 $('search-field').focus();
850 }, 852 },
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 2447
2446 settings.hidden = !isVisible; 2448 settings.hidden = !isVisible;
2447 }; 2449 };
2448 } 2450 }
2449 2451
2450 // Export 2452 // Export
2451 return { 2453 return {
2452 BrowserOptions: BrowserOptions 2454 BrowserOptions: BrowserOptions
2453 }; 2455 };
2454 }); 2456 });
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