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

Unified Diff: chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js

Issue 2796783005: MD Settings: Google Play Store: Add subpage and polish (Take 2) (Closed)
Patch Set: nit Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
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 53%
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..8f506fb62d1291b33bbc5742f45adf99a5c7da38 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,17 @@ Polymer({
prefs: Object,
/** @private {!AndroidAppsInfo|undefined} */
- androidAppsInfo_: Object,
+ androidAppsInfo: Object,
+
+ /** @private */
+ dialogBody_: {
+ type: String,
+ value: function() {
+ return this.i18nAdvanced(
+ 'androidAppsDisableDialogMessage',
+ {substitutions: [], tags: ['br']});
+ }
+ }
},
/** @private {?settings.AndroidAppsBrowserProxy} */
@@ -28,21 +38,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
@@ -50,7 +45,7 @@ Polymer({
onManageAndroidAppsKeydown_: function(event) {
if (event.key != 'Enter' && event.key != ' ')
return;
- this.browserProxy_.showAndroidAppsSettings(true /** keyboardAction */);
+ this.browserProxy_.showAndroidAppsSettings(true /** keyboardAction */);
event.stopPropagation();
},
@@ -60,25 +55,20 @@ Polymer({
},
/**
- * @return {string}
+ * @return {boolean}
* @private
*/
- getDialogBody_: function() {
- return this.i18nAdvanced(
- 'androidAppsDisableDialogMessage', {substitutions: [], tags: ['br']});
+ allowRemove_: function() {
+ return this.prefs.arc.enabled.enforcement !=
+ 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();
},
@@ -87,8 +77,9 @@ Polymer({
* @private
*/
onConfirmDisableDialogConfirm_: function() {
- /** @type {!SettingsCheckboxElement} */ (this.$.enabled).sendPrefChange();
+ this.setPrefValue('arc.enabled', false);
this.$.confirmDisableDialog.close();
+ settings.navigateToPreviousRoute();
},
/**
@@ -97,15 +88,6 @@ Polymer({
* @private
*/
onConfirmDisableDialogCancel_: function() {
- /** @type {!SettingsCheckboxElement} */ (this.$.enabled).resetToPrefValue();
this.$.confirmDisableDialog.close();
},
-
- /**
- * @param {!Event} e
- * @private
- */
- stopPropagation_: function(e) {
- e.stopPropagation();
- },
});

Powered by Google App Engine
This is Rietveld 408576698