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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js

Issue 1049403002: Make 'See more' button in suggest apps dialog keyboard accessible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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 | « ui/file_manager/file_manager/foreground/css/file_manager.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
index bd356a0ecaf67397b8f5410fd1428244c79114b4..294220e25fd02aa93d08128ff4f4cc0b3c58d4ec 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
@@ -65,9 +65,23 @@ function SuggestAppsDialog(parentNode, state) {
this.webstoreButton_ = this.document_.createElement('div');
this.webstoreButton_.hidden = true;
this.webstoreButton_.id = 'webstore-button';
- this.webstoreButton_.innerHTML = str('SUGGEST_DIALOG_LINK_TO_WEBSTORE');
+ this.webstoreButton_.setAttribute('role', 'button');
+ this.webstoreButton_.tabIndex = 0;
+
+ var webstoreButtonIcon = this.document_.createElement('span');
+ webstoreButtonIcon.id = 'webstore-button-icon';
+ this.webstoreButton_.appendChild(webstoreButtonIcon);
+
+ var webstoreButtonLabel = this.document_.createElement('span');
+ webstoreButtonLabel.id = 'webstore-button-label';
+ webstoreButtonLabel.textContent = str('SUGGEST_DIALOG_LINK_TO_WEBSTORE');
+ this.webstoreButton_.appendChild(webstoreButtonLabel);;
+
this.webstoreButton_.addEventListener(
- 'click', this.onWebstoreLinkClicked_.bind(this));
+ 'click', this.onWebstoreLinkActivated_.bind(this));
+ this.webstoreButton_.addEventListener(
+ 'keydown', this.onWebstoreLinkKeyDown_.bind(this));
+
this.buttons_.appendChild(this.webstoreButton_);
this.initialFocusElement_ = this.webviewContainer_;
@@ -301,11 +315,12 @@ SuggestAppsDialog.prototype.showInternal_ =
};
/**
- * Called when the 'See more...' link is clicked to be navigated to Webstore.
- * @param {Event} e Event.
+ * Called when the 'See more...' link is activated to be navigated to Webstore.
+ * @param {Event} e The event that activated the link. Either mouse click or
+ * key down event.
* @private
*/
-SuggestAppsDialog.prototype.onWebstoreLinkClicked_ = function(e) {
+SuggestAppsDialog.prototype.onWebstoreLinkActivated_ = function(e) {
if (!this.webStoreUrl_)
return;
util.visitURL(this.webStoreUrl_);
@@ -314,6 +329,18 @@ SuggestAppsDialog.prototype.onWebstoreLinkClicked_ = function(e) {
};
/**
+ * Key down event handler for webstore link element. If the key is enter, it
+ * activates the link.
+ * @param {Event} e The event
+ * @private
+ */
+SuggestAppsDialog.prototype.onWebstoreLinkKeyDown_ = function(e) {
+ if (e.keyCode != 13 /* Enter */)
+ return;
+ this.onWebstoreLinkActivated_(e);
+};
+
+/**
* Called when the widget is loaded successfully.
* @param {Event} event Event.
* @private
« no previous file with comments | « ui/file_manager/file_manager/foreground/css/file_manager.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698