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 * 'settings-stylus' is the settings subpage with stylus-specific settings. | 7 * 'settings-stylus' is the settings subpage with stylus-specific settings. |
8 */ | 8 */ |
9 | 9 |
10 /** @const */ var FIND_MORE_APPS_URL = 'https://play.google.com/store/apps/' + | 10 /** @const */ var FIND_MORE_APPS_URL = 'https://play.google.com/store/apps/' + |
11 'collection/promotion_30023cb_stylus_apps'; | 11 'collection/promotion_30023cb_stylus_apps'; |
12 | 12 |
13 Polymer({ | 13 Polymer({ |
14 is: 'settings-stylus', | 14 is: 'settings-stylus', |
15 | 15 |
16 properties: { | 16 properties: { |
17 /** Preferences state. */ | 17 /** Preferences state. */ |
18 prefs: { | 18 prefs: { |
19 type: Object, | 19 type: Object, |
20 notify: true, | 20 notify: true, |
21 }, | 21 }, |
22 | 22 |
23 /** | 23 /** |
24 * Note taking apps the user can pick between. | 24 * Note taking apps the user can pick between. |
25 * @type {Array<{name:string, value:string, preferred:boolean}>} | 25 * @type {Array<{name:string, value:string, preferred:boolean}>} |
26 * @private | 26 * @private |
27 */ | 27 */ |
28 appChoices_: { | 28 appChoices_: { |
29 type: Array, | 29 type: Array, |
30 value: function() { return []; } | 30 value: function() { |
| 31 return []; |
| 32 } |
31 }, | 33 }, |
32 | 34 |
33 /** | 35 /** |
34 * True if the ARC container has not finished starting yet. | 36 * True if the ARC container has not finished starting yet. |
35 * @private | 37 * @private |
36 */ | 38 */ |
37 waitingForAndroid_: { | 39 waitingForAndroid_: {type: Boolean, value: false}, |
38 type: Boolean, | |
39 value: false | |
40 }, | |
41 }, | 40 }, |
42 | 41 |
43 | 42 |
44 /** @private {?settings.DevicePageBrowserProxy} */ | 43 /** @private {?settings.DevicePageBrowserProxy} */ |
45 browserProxy_: null, | 44 browserProxy_: null, |
46 | 45 |
| 46 /** @override */ |
47 created: function() { | 47 created: function() { |
48 this.browserProxy_ = settings.DevicePageBrowserProxyImpl.getInstance(); | 48 this.browserProxy_ = settings.DevicePageBrowserProxyImpl.getInstance(); |
49 }, | 49 }, |
50 | 50 |
| 51 /** @override */ |
51 ready: function() { | 52 ready: function() { |
52 this.browserProxy_.setNoteTakingAppsUpdatedCallback( | 53 this.browserProxy_.setNoteTakingAppsUpdatedCallback( |
53 this.onNoteAppsUpdated_.bind(this)); | 54 this.onNoteAppsUpdated_.bind(this)); |
54 this.browserProxy_.requestNoteTakingApps(); | 55 this.browserProxy_.requestNoteTakingApps(); |
55 }, | 56 }, |
56 | 57 |
57 /** @private */ | 58 /** @private */ |
58 onSelectedAppChanged_: function() { | 59 onSelectedAppChanged_: function() { |
59 this.browserProxy_.setPreferredNoteTakingApp(this.$.menu.value); | 60 this.browserProxy_.setPreferredNoteTakingApp(this.$.menu.value); |
60 }, | 61 }, |
(...skipping 24 matching lines...) Expand all Loading... |
85 */ | 86 */ |
86 showApps_: function(apps, waitingForAndroid) { | 87 showApps_: function(apps, waitingForAndroid) { |
87 return apps.length > 0 && !waitingForAndroid; | 88 return apps.length > 0 && !waitingForAndroid; |
88 }, | 89 }, |
89 | 90 |
90 /** @private */ | 91 /** @private */ |
91 onFindAppsTap_: function() { | 92 onFindAppsTap_: function() { |
92 this.browserProxy_.showPlayStore(FIND_MORE_APPS_URL); | 93 this.browserProxy_.showPlayStore(FIND_MORE_APPS_URL); |
93 }, | 94 }, |
94 }); | 95 }); |
OLD | NEW |