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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'android-apps-page' is the settings page for enabling android apps. 7 * 'android-apps-page' is the settings page for enabling android apps.
8 */ 8 */
9 9
10 Polymer({ 10 Polymer({
(...skipping 27 matching lines...) Expand all
38 /** @private {?settings.AndroidAppsBrowserProxy} */ 38 /** @private {?settings.AndroidAppsBrowserProxy} */
39 browserProxy_: null, 39 browserProxy_: null,
40 40
41 /** @override */ 41 /** @override */
42 created: function() { 42 created: function() {
43 this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance(); 43 this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance();
44 }, 44 },
45 45
46 /** @override */ 46 /** @override */
47 ready: function() { 47 ready: function() {
48 cr.addWebUIListener( 48 this.listener_ = cr.addWebUIListener(
49 'android-apps-info-update', this.androidAppsInfoUpdate_.bind(this)); 49 'android-apps-info-update', this.androidAppsInfoUpdate_.bind(this));
50 this.browserProxy_.requestAndroidAppsInfo(); 50 this.browserProxy_.requestAndroidAppsInfo();
51 }, 51 },
52
52 /** 53 /**
53 * @param {AndroidAppsInfo} info 54 * @param {AndroidAppsInfo} info
54 * @private 55 * @private
55 */ 56 */
56 androidAppsInfoUpdate_: function(info) { 57 androidAppsInfoUpdate_: function(info) {
57 this.androidAppsInfo_ = info; 58 this.androidAppsInfo_ = info;
58 }, 59 },
59 60
60 /** 61 /**
61 * @param {Event} event 62 * @param {Event} event
62 * @private 63 * @private
63 */ 64 */
64 onEnableTap_: function(event) { 65 onEnableTap_: function(event) {
65 this.setPrefValue('arc.enabled', true); 66 this.setPrefValue('arc.enabled', true);
66 event.stopPropagation(); 67 event.stopPropagation();
67 }, 68 },
68 69
69 /** @private */ 70 /** @private */
70 onSubpageTap_: function() { 71 onSubpageTap_: function() {
71 if (this.androidAppsInfo_.appReady) 72 if (this.androidAppsInfo_.playStoreEnabled)
72 settings.navigateTo(settings.Route.ANDROID_APPS_DETAILS); 73 settings.navigateTo(settings.Route.ANDROID_APPS_DETAILS);
73 }, 74 },
75
76 /**
77 * Discards current element from handling android-apps-info-update events.
78 */
79 discardForTest: function() {
80 if (this.listener_) {
81 cr.removeWebUIListener(this.listener_);
82 this.listener_ = null;
83 }
84 },
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.
74 }); 85 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698