OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @fileoverview Handles output for Chrome's built-in find. | 5 * @fileoverview Handles output for Chrome's built-in find. |
6 */ | 6 */ |
7 goog.provide('FindHandler'); | 7 goog.provide('FindHandler'); |
8 | 8 |
9 goog.require('Output'); | 9 goog.require('Output'); |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 FindHandler.uninit_ = function() { | 40 FindHandler.uninit_ = function() { |
41 chrome.automation.removeTreeChangeObserver(FindHandler.onTextMatch_); | 41 chrome.automation.removeTreeChangeObserver(FindHandler.onTextMatch_); |
42 }; | 42 }; |
43 | 43 |
44 /** | 44 /** |
45 * @param {Object} evt | 45 * @param {Object} evt |
46 * @private | 46 * @private |
47 */ | 47 */ |
48 FindHandler.onTextMatch_ = function(evt) { | 48 FindHandler.onTextMatch_ = function(evt) { |
49 if (!evt.target.markerTypes.some(function(markerType) { | 49 if (!evt.target.markerTypes.some(function(markerType) { |
50 return markerType & 4 /* Text match */; | 50 return markerType & 4 /* Text match */; |
51 })) | 51 })) |
52 return; | 52 return; |
53 | 53 |
54 var range = cursors.Range.fromNode(evt.target); | 54 var range = cursors.Range.fromNode(evt.target); |
55 ChromeVoxState.instance.setCurrentRange(range); | 55 ChromeVoxState.instance.setCurrentRange(range); |
56 new Output() | 56 new Output() |
57 .withRichSpeechAndBraille(range, null, Output.EventType.NAVIGATE) | 57 .withRichSpeechAndBraille(range, null, Output.EventType.NAVIGATE) |
58 .go(); | 58 .go(); |
59 }; | 59 }; |
60 | 60 |
61 }); // goog.scope | 61 }); // goog.scope |
OLD | NEW |