| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview Installs stubs for unsupported api's on some platforms. Define |
| 7 * the stubs here and require Stubs in the calling file. |
| 8 */ |
| 9 |
| 10 goog.provide('Stubs'); |
| 11 |
| 12 goog.require('cvox.ChromeVox'); |
| 13 |
| 14 /** Initializes this module. */ |
| 15 Stubs.init = function() { |
| 16 // These api's throw for non-Chrome OS. |
| 17 if (!cvox.ChromeVox.isChromeOS) { |
| 18 chrome.accessibilityPrivate.onAccessibilityGesture = {}; |
| 19 chrome.accessibilityPrivate.onAccessibilityGesture.addListener = |
| 20 function() {}; |
| 21 chrome.accessibilityPrivate.setFocusRing = function() {}; |
| 22 chrome.accessibilityPrivate.setKeyboardListener = function() {}; |
| 23 } |
| 24 |
| 25 // This api throws on Mac. |
| 26 if (cvox.ChromeVox.isMac) { |
| 27 chrome.automation.getDesktop = function() {}; |
| 28 } |
| 29 |
| 30 // Missing api's until 53. |
| 31 if (!chrome.automation.NameFromType) { |
| 32 chrome.automation['NameFromType'] = {}; |
| 33 chrome.automation['DescriptionFromType'] = {}; |
| 34 } |
| 35 }; |
| 36 |
| 37 Stubs.init(); |
| OLD | NEW |