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

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: attached/detached approach 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 15 matching lines...) Expand all
26 focusConfig_: { 26 focusConfig_: {
27 type: Object, 27 type: Object,
28 value: function() { 28 value: function() {
29 var map = new Map(); 29 var map = new Map();
30 map.set( 30 map.set(
31 settings.Route.ANDROID_APPS_DETAILS.path, 31 settings.Route.ANDROID_APPS_DETAILS.path,
32 '#android-apps .subpage-arrow'); 32 '#android-apps .subpage-arrow');
33 return map; 33 return map;
34 }, 34 },
35 }, 35 },
36
37 /** @private {!WebUIListener} */
stevenjb 2017/05/11 20:33:51 This can just be a member variable like browserPro
khmel 2017/05/11 20:38:11 Done.
38 listener_: Object,
36 }, 39 },
37 40
38 /** @private {?settings.AndroidAppsBrowserProxy} */ 41 /** @private {?settings.AndroidAppsBrowserProxy} */
39 browserProxy_: null, 42 browserProxy_: null,
40 43
41 /** @override */ 44 /** @override */
42 created: function() { 45 created: function() {
43 this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance(); 46 this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance();
44 }, 47 },
45 48
46 /** @override */ 49 /** @override */
47 ready: function() { 50 attached: function() {
48 cr.addWebUIListener( 51 this.listener_ = cr.addWebUIListener(
49 'android-apps-info-update', this.androidAppsInfoUpdate_.bind(this)); 52 'android-apps-info-update', this.androidAppsInfoUpdate_.bind(this));
50 this.browserProxy_.requestAndroidAppsInfo(); 53 this.browserProxy_.requestAndroidAppsInfo();
51 }, 54 },
55
56 /** @override */
57 detached: function() {
58 cr.removeWebUIListener(this.listener_);
59 },
60
52 /** 61 /**
53 * @param {AndroidAppsInfo} info 62 * @param {AndroidAppsInfo} info
54 * @private 63 * @private
55 */ 64 */
56 androidAppsInfoUpdate_: function(info) { 65 androidAppsInfoUpdate_: function(info) {
57 this.androidAppsInfo_ = info; 66 this.androidAppsInfo_ = info;
58 }, 67 },
59 68
60 /** 69 /**
61 * @param {Event} event 70 * @param {Event} event
62 * @private 71 * @private
63 */ 72 */
64 onEnableTap_: function(event) { 73 onEnableTap_: function(event) {
65 this.setPrefValue('arc.enabled', true); 74 this.setPrefValue('arc.enabled', true);
66 event.stopPropagation(); 75 event.stopPropagation();
67 }, 76 },
68 77
69 /** @private */ 78 /** @private */
70 onSubpageTap_: function() { 79 onSubpageTap_: function() {
71 if (this.androidAppsInfo_.appReady) 80 if (this.androidAppsInfo_.playStoreEnabled)
72 settings.navigateTo(settings.Route.ANDROID_APPS_DETAILS); 81 settings.navigateTo(settings.Route.ANDROID_APPS_DETAILS);
73 }, 82 },
74 }); 83 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698