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

Unified Diff: chrome/browser/resources/settings/device_page/stylus.js

Issue 2630623002: cros: Allow user to configure note taking app in md-settings. (Closed)
Patch Set: Initial upload Created 3 years, 11 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/device_page/stylus.js
diff --git a/chrome/browser/resources/settings/device_page/stylus.js b/chrome/browser/resources/settings/device_page/stylus.js
index a31df1d433c5b0290731fa10c112a73d6955aa59..a2676a10365119d64cb46a834e922e9b47cb12fd 100644
--- a/chrome/browser/resources/settings/device_page/stylus.js
+++ b/chrome/browser/resources/settings/device_page/stylus.js
@@ -7,6 +7,9 @@
* 'settings-stylus' is the settings subpage with stylus-specific settings.
*/
+/** @const */ var FIND_MORE_APPS_URL =
+ 'https://play.google.com/store/apps/collection/promotion_30023cb_stylus_apps';
stevenjb 2017/01/19 17:48:53 Use '+' and multiple strings to avoid wrapping.
jdufault 2017/01/25 00:52:22 Done.
+
Polymer({
is: 'settings-stylus',
@@ -16,5 +19,53 @@ Polymer({
type: Object,
notify: true,
},
- }
+
+ /**
+ * Note taking apps the user can pick between.
+ * @type {Array<{name:string, value:string, preferred:boolean}>}
+ * @private
+ */
+ appChoices_: [],
stevenjb 2017/01/19 17:48:53 appChoices_ : { type: Array, value: function()
jdufault 2017/01/25 00:52:22 Done, since this makes it clearer. However, we nev
+
+ /**
+ * True if the arc++ container has not finished starting yet.
Daniel Erat 2017/01/19 00:50:05 nit: i think i read/heard somewhere that we just c
jdufault 2017/01/25 00:52:22 Done.
+ * @type {boolean}
stevenjb 2017/01/19 17:48:53 not needed, see below.
jdufault 2017/01/25 00:52:22 Done.
+ * @private
+ */
+ waitingForAndroid_: false,
stevenjb 2017/01/19 17:48:53 waitingForAndroid_: { type: Boolean, value: fa
jdufault 2017/01/25 00:52:22 Done. It's strange that if closure can understand
+ },
+
+ ready: function() {
+ cr.addWebUIListener(
+ 'onNoteTakingAppsUpdated',
+ this.onNoteAppsUpdated_.bind(this));
+
+ chrome.send('requestNoteTakingApps');
stevenjb 2017/01/19 17:48:53 In order to test this we will want to set up a pro
jdufault 2017/01/25 00:52:22 Done.
+ },
+
+ /** @private */
+ onSelectedAppChanged_: function() {
+ chrome.send('setPreferredNoteTakingApp', [this.$.menu.value]);
+ },
+
+ /** @private */
stevenjb 2017/01/19 17:48:53 Need @type for all args
jdufault 2017/01/25 00:52:22 Done.
+ onNoteAppsUpdated_: function(apps, waitingForAndroid) {
+ this.waitingForAndroid_ = waitingForAndroid;
+ this.appChoices_ = apps;
+ },
+
+ /** @private */
+ showNoApps_: function(apps, waitingForAndroid) {
+ return apps.length == 0 && !waitingForAndroid;
+ },
+
+ /** @private */
+ showApps_: function(apps, waitingForAndroid) {
+ return apps.length > 0 && !waitingForAndroid;
+ },
+
+ /** @private */
+ onFindAppsTap_: function() {
+ window.open(FIND_MORE_APPS_URL);
+ },
});

Powered by Google App Engine
This is Rietveld 408576698