Chromium Code Reviews| Index: chrome/browser/chromeos/accessibility/accessibility_util.cc |
| diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc |
| index 3d2d95d4a1f146a7b5c19e0515ed3129079ba6ff..16bd4df85609a89cd69928957003a4244423db02 100644 |
| --- a/chrome/browser/chromeos/accessibility/accessibility_util.cc |
| +++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc |
| @@ -7,8 +7,13 @@ |
| #include "base/prefs/pref_service.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/ui/singleton_tabs.h" |
| +#include "chrome/common/extensions/extension_constants.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| +#include "content/public/test/browser_test_utils.h" |
| +#include "extensions/browser/extension_host.h" |
| +#include "extensions/browser/extension_system.h" |
| +#include "extensions/browser/process_manager.h" |
| #include "url/gurl.h" |
| // TODO(yoshiki): move the following method to accessibility_manager.cc and |
| @@ -38,5 +43,20 @@ void ShowAccessibilityHelp(Browser* browser) { |
| chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL)); |
| } |
| + |
| +void SimulateTouchScreenInChromeVoxForTest(content::BrowserContext* profile) { |
| + // ChromeVox looks at whether 'ontouchstart' exists to know whether |
| + // or not it should respond to hover events. Fake it so that touch |
| + // exploration events get spoken. |
| + extensions::ExtensionHost* host = |
| + extensions::ExtensionSystem::Get(profile) |
| + ->process_manager() |
| + ->GetBackgroundHostForExtension( |
| + extension_misc::kChromeVoxExtensionId); |
| + CHECK(content::ExecuteScript( |
| + host->host_contents(), |
| + "if (!('ontouchstart' in window)) window.ontouchstart = function() {};")); |
|
James Cook
2014/08/08 20:26:46
You should make sure these tests still pass with t
evy
2014/08/08 21:00:29
They do still pass. Should I keep the change or le
|
| +} |
| + |
| } // namespace accessibility |
| } // namespace chromeos |