Chromium Code Reviews| Index: chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js |
| diff --git a/chrome/browser/resources/settings/android_apps_page/android_apps_page.js b/chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js |
| similarity index 58% |
| copy from chrome/browser/resources/settings/android_apps_page/android_apps_page.js |
| copy to chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js |
| index 53128b7f70fd29c2ec19594d8a381209d536929b..f0cad9412f30257d9145940881b8a30e794bcbf1 100644 |
| --- a/chrome/browser/resources/settings/android_apps_page/android_apps_page.js |
| +++ b/chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js |
| @@ -4,11 +4,11 @@ |
| /** |
| * @fileoverview |
| - * 'android-apps-page' is the settings page for enabling android apps. |
| + * 'android-apps-subpage' is the settings subpage for managing android apps. |
| */ |
| Polymer({ |
| - is: 'settings-android-apps-page', |
| + is: 'settings-android-apps-subpage', |
| behaviors: [I18nBehavior, PrefsBehavior], |
| @@ -17,7 +17,7 @@ Polymer({ |
| prefs: Object, |
| /** @private {!AndroidAppsInfo|undefined} */ |
| - androidAppsInfo_: Object, |
| + androidAppsInfo: Object, |
| }, |
| /** @private {?settings.AndroidAppsBrowserProxy} */ |
| @@ -28,21 +28,6 @@ Polymer({ |
| this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance(); |
| }, |
| - /** @override */ |
| - ready: function() { |
| - cr.addWebUIListener( |
| - 'android-apps-info-update', this.androidAppsInfoUpdate_.bind(this)); |
| - this.browserProxy_.requestAndroidAppsInfo(); |
| - }, |
| - |
| - /** |
| - * @param {AndroidAppsInfo} info |
| - * @private |
| - */ |
| - androidAppsInfoUpdate_: function(info) { |
| - this.androidAppsInfo_ = info; |
| - }, |
| - |
| /** |
| * @param {Event} event |
| * @private |
| @@ -60,35 +45,40 @@ Polymer({ |
| }, |
| /** |
| - * @return {string} |
| + * @return {boolean} |
| * @private |
| */ |
| - getDialogBody_: function() { |
| - return this.i18nAdvanced( |
| - 'androidAppsDisableDialogMessage', {substitutions: [], tags: ['br']}); |
| + allowRemove_() { |
|
Dan Beam
2017/03/30 13:24:22
also using ES6
stevenjb
2017/03/30 23:05:37
Done.
|
| + return this.prefs.arc.enabled.enforcement != |
|
Dan Beam
2017/03/30 13:24:22
i don't think this will work with closure.
you mi
stevenjb
2017/03/30 23:05:37
It does.
Since prefs.arc.enabled will always exis
|
| + chrome.settingsPrivate.Enforcement.ENFORCED; |
| }, |
| /** |
| - * Handles the change event for the arc.enabled checkbox. Shows a |
| - * confirmation dialog when disabling the preference. |
| + * Shows a confirmation dialog when disabling android apps. |
| * @param {Event} event |
| * @private |
| */ |
| - onArcEnabledChange_: function(event) { |
| - if (event.target.checked) { |
| - /** @type {!SettingsCheckboxElement} */ (event.target).sendPrefChange(); |
| - return; |
| - } |
| + onRemoveTap_: function(event) { |
| this.$.confirmDisableDialog.showModal(); |
| }, |
|
Dan Beam
2017/03/30 13:24:22
extra \n
stevenjb
2017/03/30 23:05:37
Done.
|
| + |
| + /** |
| + * @return {string} |
| + * @private |
| + */ |
| + getDialogBody_: function() { |
| + return this.i18nAdvanced('androidAppsDisableDialogMessage', {}); |
|
Dan Beam
2017/03/30 13:24:22
is this equivalent to i18n()?
stevenjb
2017/03/30 23:05:37
Done.
|
| + }, |
| + |
| /** |
| * Handles the shared proxy confirmation dialog 'Confirm' button. |
| * @private |
| */ |
| onConfirmDisableDialogConfirm_: function() { |
| - /** @type {!SettingsCheckboxElement} */ (this.$.enabled).sendPrefChange(); |
| + this.setPrefValue('arc.enabled', false); |
| this.$.confirmDisableDialog.close(); |
| + settings.navigateToPreviousRoute(); |
| }, |
| /** |
| @@ -97,15 +87,6 @@ Polymer({ |
| * @private |
| */ |
| onConfirmDisableDialogCancel_: function() { |
| - /** @type {!SettingsCheckboxElement} */ (this.$.enabled).resetToPrefValue(); |
| this.$.confirmDisableDialog.close(); |
| }, |
| - |
| - /** |
| - * @param {!Event} e |
| - * @private |
| - */ |
| - stopPropagation_: function(e) { |
| - e.stopPropagation(); |
| - }, |
| }); |