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

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

Issue 2873853002: arc: Handle ARC events in MD Settings (Closed)
Patch Set: comments addressed Created 3 years, 7 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 861731780652ab51607d5907c609012ddb6e61da..44c82f8275b9cf2256e8ae889b538ed2352049cb 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
@@ -45,10 +45,11 @@ Polymer({
/** @override */
ready: function() {
- cr.addWebUIListener(
+ this.listener_ = cr.addWebUIListener(
'android-apps-info-update', this.androidAppsInfoUpdate_.bind(this));
this.browserProxy_.requestAndroidAppsInfo();
},
+
/**
* @param {AndroidAppsInfo} info
* @private
@@ -68,7 +69,17 @@ Polymer({
/** @private */
onSubpageTap_: function() {
- if (this.androidAppsInfo_.appReady)
+ if (this.androidAppsInfo_.playStoreEnabled)
settings.navigateTo(settings.Route.ANDROID_APPS_DETAILS);
},
+
+ /**
+ * Discards current element from handling android-apps-info-update events.
+ */
+ discardForTest: function() {
+ if (this.listener_) {
+ cr.removeWebUIListener(this.listener_);
+ this.listener_ = null;
+ }
+ },
stevenjb 2017/05/11 19:40:43 There is a better way to do this, see comments in
khmel 2017/05/11 20:26:42 Done as chatted.
});

Powered by Google App Engine
This is Rietveld 408576698