OLD | NEW |
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-subpage' is the settings subpage for managing android apps. | 7 * 'android-apps-subpage' is the settings subpage for managing android apps. |
8 */ | 8 */ |
9 | 9 |
10 Polymer({ | 10 Polymer({ |
11 is: 'settings-android-apps-subpage', | 11 is: 'settings-android-apps-subpage', |
12 | 12 |
13 behaviors: [I18nBehavior, PrefsBehavior], | 13 behaviors: [I18nBehavior, PrefsBehavior], |
14 | 14 |
15 properties: { | 15 properties: { |
16 /** Preferences state. */ | 16 /** Preferences state. */ |
17 prefs: Object, | 17 prefs: Object, |
18 | 18 |
19 /** @private {!AndroidAppsInfo|undefined} */ | 19 /** @private {!AndroidAppsInfo|undefined} */ |
20 androidAppsInfo: Object, | 20 androidAppsInfo: { |
| 21 type: Object, |
| 22 observer: 'onAndroidAppsInfoUpdate_', |
| 23 }, |
21 | 24 |
22 /** @private */ | 25 /** @private */ |
23 dialogBody_: { | 26 dialogBody_: { |
24 type: String, | 27 type: String, |
25 value: function() { | 28 value: function() { |
26 return this.i18nAdvanced( | 29 return this.i18nAdvanced( |
27 'androidAppsDisableDialogMessage', | 30 'androidAppsDisableDialogMessage', |
28 {substitutions: [], tags: ['br']}); | 31 {substitutions: [], tags: ['br']}); |
29 } | 32 } |
30 } | 33 } |
31 }, | 34 }, |
32 | 35 |
33 /** @private {?settings.AndroidAppsBrowserProxy} */ | 36 /** @private {?settings.AndroidAppsBrowserProxy} */ |
34 browserProxy_: null, | 37 browserProxy_: null, |
35 | 38 |
36 /** @override */ | 39 /** @override */ |
37 created: function() { | 40 created: function() { |
38 this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance(); | 41 this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance(); |
39 }, | 42 }, |
40 | 43 |
41 /** | 44 /** |
| 45 * @private |
| 46 */ |
| 47 onAndroidAppsInfoUpdate_: function() { |
| 48 if (!this.androidAppsInfo.playStoreEnabled) |
| 49 settings.navigateToPreviousRoute(); |
| 50 }, |
| 51 |
| 52 /** |
42 * @param {Event} event | 53 * @param {Event} event |
43 * @private | 54 * @private |
44 */ | 55 */ |
45 onManageAndroidAppsKeydown_: function(event) { | 56 onManageAndroidAppsKeydown_: function(event) { |
46 if (event.key != 'Enter' && event.key != ' ') | 57 if (event.key != 'Enter' && event.key != ' ') |
47 return; | 58 return; |
48 this.browserProxy_.showAndroidAppsSettings(true /** keyboardAction */); | 59 this.browserProxy_.showAndroidAppsSettings(true /** keyboardAction */); |
49 event.stopPropagation(); | 60 event.stopPropagation(); |
50 }, | 61 }, |
51 | 62 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 */ | 100 */ |
90 onConfirmDisableDialogCancel_: function() { | 101 onConfirmDisableDialogCancel_: function() { |
91 this.$.confirmDisableDialog.close(); | 102 this.$.confirmDisableDialog.close(); |
92 }, | 103 }, |
93 | 104 |
94 /** @private */ | 105 /** @private */ |
95 onConfirmDisableDialogClose_: function() { | 106 onConfirmDisableDialogClose_: function() { |
96 cr.ui.focusWithoutInk(assert(this.$$('#remove button'))); | 107 cr.ui.focusWithoutInk(assert(this.$$('#remove button'))); |
97 }, | 108 }, |
98 }); | 109 }); |
OLD | NEW |