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

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: NoteAppInfo => settings.NoteAppInfo Created 3 years, 10 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
« no previous file with comments | « chrome/browser/resources/settings/device_page/stylus.html ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d04fc94845ed0db65b52637e853d203f4df22cd1 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';
+
Polymer({
is: 'settings-stylus',
@@ -16,5 +19,76 @@ Polymer({
type: Object,
notify: true,
},
- }
+
+ /**
+ * Note taking apps the user can pick between.
+ * @type {Array<{name:string, value:string, preferred:boolean}>}
+ * @private
+ */
+ appChoices_: {
+ type: Array,
+ value: function() { return []; }
+ },
+
+ /**
+ * True if the ARC container has not finished starting yet.
+ * @private
+ */
+ waitingForAndroid_: {
+ type: Boolean,
+ value: false
+ },
+ },
+
+
+ /** @private {?settings.DevicePageBrowserProxy} */
+ browserProxy_: null,
+
+ created: function() {
+ this.browserProxy_ = settings.DevicePageBrowserProxyImpl.getInstance();
+ },
+
+ ready: function() {
+ this.browserProxy_.setNoteTakingAppsUpdatedCallback(
+ this.onNoteAppsUpdated_.bind(this));
+ this.browserProxy_.requestNoteTakingApps();
+ },
+
+ /** @private */
+ onSelectedAppChanged_: function() {
+ this.browserProxy_.setPreferredNoteTakingApp(this.$.menu.value);
+ },
+
+ /**
+ * @param {Array<settings.NoteAppInfo>} apps
+ * @param {boolean} waitingForAndroid
+ * @private
+ */
+ onNoteAppsUpdated_: function(apps, waitingForAndroid) {
+ this.waitingForAndroid_ = waitingForAndroid;
+ this.appChoices_ = apps;
+ },
+
+ /**
+ * @param {Array<settings.NoteAppInfo>} apps
+ * @param {boolean} waitingForAndroid
+ * @private
+ */
+ showNoApps_: function(apps, waitingForAndroid) {
+ return apps.length == 0 && !waitingForAndroid;
+ },
+
+ /**
+ * @param {Array<settings.NoteAppInfo>} apps
+ * @param {boolean} waitingForAndroid
+ * @private
+ */
+ showApps_: function(apps, waitingForAndroid) {
+ return apps.length > 0 && !waitingForAndroid;
+ },
+
+ /** @private */
+ onFindAppsTap_: function() {
+ window.open(FIND_MORE_APPS_URL);
+ },
});
« no previous file with comments | « chrome/browser/resources/settings/device_page/stylus.html ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698