Index: chrome/browser/resources/uber/uber.js |
diff --git a/chrome/browser/resources/uber/uber.js b/chrome/browser/resources/uber/uber.js |
index c46a82137592b2e0859c425b8ff24cd550aa17b9..02cd749e4b4bf1f045d27918084f07d848d315df 100644 |
--- a/chrome/browser/resources/uber/uber.js |
+++ b/chrome/browser/resources/uber/uber.js |
@@ -138,6 +138,10 @@ cr.define('uber', function() { |
showPage(e.data.params.pageId, HISTORY_STATE_OPTION.PUSH); |
else if (e.data.method === 'navigationControlsLoaded') |
onNavigationControlsLoaded(); |
+ else if (e.data.method === 'enableNavigationItemTabbing') |
+ setNavigationItemTabbing(true); |
+ else if (e.data.method === 'disableNavigationItemTabbing') |
+ setNavigationItemTabbing(false); |
else if (e.data.method === 'adjustToScroll') |
adjustToScroll(e.data.params); |
else if (e.data.method === 'mouseWheel') |
@@ -330,6 +334,18 @@ cr.define('uber', function() { |
uber.invokeMethodOnWindow(iframe.contentWindow, 'mouseWheel', params); |
} |
+ /** |
+ * Enables or disables the ability to tab to the navigation items. |
+ * @param {boolean} enabled If true, enables tabbing; if false, disables it. |
+ */ |
+ function setNavigationItemTabbing(enabled) { |
+ navFrame.firstChild.tabIndex = enabled ? 0 : -1; |
+ if (enabled) |
+ navFrame.firstChild.removeAttribute('aria-hidden'); |
+ else |
+ navFrame.firstChild.setAttribute('aria-hidden', true); |
+ } |
+ |
return { |
onLoad: onLoad, |
onPopHistoryState: onPopHistoryState |