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

Unified Diff: chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js

Issue 1856553002: [Media Router WebUI] Move dialog load focusing to container. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per mfoltz@'s comments. Created 4 years, 8 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/media_router/elements/media_router_header/media_router_header.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
diff --git a/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js b/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
index 0eb1e45dae8b6e1a73ff005972e09d4b3a5b1d1d..2f735fc09acd8e3737c35c6c96857a297ab06b2e 100644
--- a/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
+++ b/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
@@ -98,14 +98,6 @@ Polymer({
'focus': 'onFocus_',
},
- ready: function() {
- // If this is not on a Mac platform, remove the placeholder. See
- // onFocus_() for more details. ready() is only called once, so no need
- // to check if the placeholder exist before removing.
- if (!cr.isMac)
- this.$$('#focus-placeholder').remove();
- },
-
attached: function() {
// isRTL() only works after i18n_template.js runs to set <html dir>.
// Set the back button icon based on text direction.
@@ -174,28 +166,6 @@ Polymer({
},
/**
- * Called when a focus event is triggered.
- *
- * @param {!Event} event The event object.
- * @private
- */
- onFocus_: function(event) {
- // If the focus event was not triggered by the user, remove focus from
- // the element. This prevents unexpected focusing when the dialog is
- // initially loaded.
- // This only happens on mac.
- if (cr.isMac && !event.sourceCapabilities) {
- event.path[0].blur();
- // Adding a focus placeholder element is part of the workaround for
- // handling unexpected focusing, which only happens once on dialog open.
- // Since #focus-placeholder initially is focus-enabled, as denoted by
- // its tabindex value, the focus will not appear in other elements.
- // Remove the placeholder since we have no more use for it.
- this.$$('#focus-placeholder').remove();
- }
- },
-
- /**
* Handles a click on the arrow button by firing an arrow-click event.
*
* @private
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_header/media_router_header.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698