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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/chromevox.js

Issue 1137403003: Fix ChromeVox's detection of whether the current document has focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Defines a global object. The initialization of this 6 * @fileoverview Defines a global object. The initialization of this
7 * object happens in init.js. 7 * object happens in init.js.
8 * 8 *
9 */ 9 */
10 10
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 * @return {HTMLElement} with the id. 268 * @return {HTMLElement} with the id.
269 */ 269 */
270 function $(id) { 270 function $(id) {
271 return document.getElementById(id); 271 return document.getElementById(id);
272 } 272 }
273 273
274 /** 274 /**
275 * @param {Array} tabs 275 * @param {Array} tabs
276 */ 276 */
277 cvox.ChromeVox.injectChromeVoxIntoTabs = function(tabs) {}; 277 cvox.ChromeVox.injectChromeVoxIntoTabs = function(tabs) {};
278
279 /**
280 * Returns whether the document has focus, taking into account whether
281 * it's hidden and also that if an iframe or webview element has focus,
282 * the focus is really inside that frame and not in this document.
283 * @return {boolean} True if the document has focus.
284 */
285 cvox.ChromeVox.documentHasFocus = function() {
286 if (!document.hasFocus() || document.hidden) {
287 return false;
288 }
289 if (document.activeElement.tagName == 'IFRAME' ||
290 document.activeElement.tagName == 'WEBVIEW') {
291 return false;
292 }
293 return true;
294 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698