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

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

Issue 2798753002: Revert of MD Settings: Google Play Store: Add subpage and polish (Closed)
Patch Set: 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_page.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_page.js
index a985566431219f803d9e4417dd5974155d5653c2..53128b7f70fd29c2ec19594d8a381209d536929b 100644
--- a/chrome/browser/resources/settings/android_apps_page/android_apps_page.js
+++ b/chrome/browser/resources/settings/android_apps_page/android_apps_page.js
@@ -14,10 +14,7 @@
properties: {
/** Preferences state. */
- prefs: {
- type: Object,
- notify: true,
- },
+ prefs: Object,
/** @private {!AndroidAppsInfo|undefined} */
androidAppsInfo_: Object,
@@ -37,6 +34,7 @@
'android-apps-info-update', this.androidAppsInfoUpdate_.bind(this));
this.browserProxy_.requestAndroidAppsInfo();
},
+
/**
* @param {AndroidAppsInfo} info
* @private
@@ -45,27 +43,69 @@
this.androidAppsInfo_ = info;
},
- /** @return {string} */
- getSubtext_: function() {
- // TODO(stevenjb): Change the text when appReady to 'toggleOn' or whatever
- // UX finally decides on. Discussion in crbug.com/698463.
- return this.androidAppsInfo_.appReady ? this.i18n('androidAppsSubtext') :
- this.i18n('androidAppsSubtext');
- },
-
/**
* @param {Event} event
* @private
*/
- onEnableTap_: function(event) {
- this.setPrefValue('arc.enabled', true);
+ onManageAndroidAppsKeydown_: function(event) {
+ if (event.key != 'Enter' && event.key != ' ')
+ return;
+ this.browserProxy_.showAndroidAppsSettings(true /** keyboardAction */);
event.stopPropagation();
},
/** @private */
- onSubpageTap_: function() {
- if (!this.androidAppsInfo_.appReady)
+ onManageAndroidAppsTap_: function(event) {
+ this.browserProxy_.showAndroidAppsSettings(false /** keyboardAction */);
+ },
+
+ /**
+ * @return {string}
+ * @private
+ */
+ getDialogBody_: function() {
+ return this.i18nAdvanced(
+ 'androidAppsDisableDialogMessage', {substitutions: [], tags: ['br']});
+ },
+
+ /**
+ * Handles the change event for the arc.enabled checkbox. Shows a
+ * confirmation dialog when disabling the preference.
+ * @param {Event} event
+ * @private
+ */
+ onArcEnabledChange_: function(event) {
+ if (event.target.checked) {
+ /** @type {!SettingsCheckboxElement} */ (event.target).sendPrefChange();
return;
- settings.navigateTo(settings.Route.ANDROID_APPS_DETAILS);
+ }
+ this.$.confirmDisableDialog.showModal();
+ },
+
+ /**
+ * Handles the shared proxy confirmation dialog 'Confirm' button.
+ * @private
+ */
+ onConfirmDisableDialogConfirm_: function() {
+ /** @type {!SettingsCheckboxElement} */ (this.$.enabled).sendPrefChange();
+ this.$.confirmDisableDialog.close();
+ },
+
+ /**
+ * Handles the shared proxy confirmation dialog 'Cancel' button or a cancel
+ * event.
+ * @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