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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js

Issue 2442583002: Invalidate the text edit handler on selection events (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 Handles automation from a desktop automation node. 6 * @fileoverview Handles automation from a desktop automation node.
7 */ 7 */
8 8
9 goog.provide('DesktopAutomationHandler'); 9 goog.provide('DesktopAutomationHandler');
10 10
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 onScrollPositionChanged: function(evt) { 421 onScrollPositionChanged: function(evt) {
422 var currentRange = ChromeVoxState.instance.currentRange; 422 var currentRange = ChromeVoxState.instance.currentRange;
423 if (currentRange && currentRange.isValid() && this.shouldOutput_(evt)) 423 if (currentRange && currentRange.isValid() && this.shouldOutput_(evt))
424 new Output().withLocation(currentRange, null, evt.type).go(); 424 new Output().withLocation(currentRange, null, evt.type).go();
425 }, 425 },
426 426
427 /** 427 /**
428 * @param {!AutomationEvent} evt 428 * @param {!AutomationEvent} evt
429 */ 429 */
430 onSelection: function(evt) { 430 onSelection: function(evt) {
431 // Invalidate any previous editable text handler state.
dmazzoni 2016/10/21 20:13:05 Could you comment that this is because we get sele
David Tseng 2016/10/24 16:35:31 Done.
432 this.textEditHandler_ = null;
433
431 chrome.automation.getFocus(function(focus) { 434 chrome.automation.getFocus(function(focus) {
432 // Desktop tabs get "selection" when there's a focused webview during tab 435 // Desktop tabs get "selection" when there's a focused webview during tab
433 // switching. 436 // switching.
434 if (focus.role == RoleType.webView && evt.target.role == RoleType.tab) { 437 if (focus.role == RoleType.webView && evt.target.role == RoleType.tab) {
435 ChromeVoxState.instance.setCurrentRange( 438 ChromeVoxState.instance.setCurrentRange(
436 cursors.Range.fromNode(focus.firstChild)); 439 cursors.Range.fromNode(focus.firstChild));
437 return; 440 return;
438 } 441 }
439 442
440 // Some cases (e.g. in overview mode), require overriding the assumption 443 // Some cases (e.g. in overview mode), require overriding the assumption
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 DesktopAutomationHandler.init_ = function() { 511 DesktopAutomationHandler.init_ = function() {
509 chrome.automation.getDesktop(function(desktop) { 512 chrome.automation.getDesktop(function(desktop) {
510 ChromeVoxState.desktopAutomationHandler = 513 ChromeVoxState.desktopAutomationHandler =
511 new DesktopAutomationHandler(desktop); 514 new DesktopAutomationHandler(desktop);
512 }); 515 });
513 }; 516 };
514 517
515 DesktopAutomationHandler.init_(); 518 DesktopAutomationHandler.init_();
516 519
517 }); // goog.scope 520 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698