Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |