Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 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 #include "base/command_line.h" | |
| 6 #include "content/browser/accessibility/accessibility_mode_helper.h" | |
|
David Tseng
2014/02/06 19:13:44
I think this goes above all other includes.
aboxhall
2014/02/06 21:04:12
Oops, done.
| |
| 7 #include "content/public/common/content_switches.h" | |
| 8 | |
| 9 namespace content { | |
| 10 | |
| 11 unsigned int AddAccessibilityModeTo(unsigned int to, | |
| 12 AccessibilityMode mode_to_add) { | |
| 13 return to | mode_to_add; | |
| 14 } | |
| 15 | |
| 16 unsigned int RemoveAccessibilityModeFrom(unsigned int from, | |
| 17 AccessibilityMode mode_to_remove) { | |
| 18 int new_mode = from ^ (mode_to_remove & from); | |
| 19 #if defined(OS_WIN) | |
| 20 // On Windows 8, always enable accessibility for editable text controls | |
| 21 // so we can show the virtual keyboard when one is enabled. | |
| 22 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | |
| 23 !CommandLine::ForCurrentProcess()->HasSwitch( | |
|
David Tseng
2014/02/06 19:13:44
Seems unexpected to have the addition of this flag
aboxhall
2014/02/06 21:04:12
Done, although note that this code is functionally
| |
| 24 switches::kDisableRendererAccessibility)) { | |
| 25 AddAccessibilityModeTo(new_mode, AccessibilityModeEditableTextOnly); | |
| 26 } | |
| 27 #endif // defined(OS_WIN) | |
| 28 | |
| 29 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 30 switches::kForceRendererAccessibility)) { | |
| 31 AddAccessibilityModeTo(new_mode, AccessibilityModeComplete); | |
|
David Tseng
2014/02/06 19:13:44
Also, seems odd to have this as a side effect of r
aboxhall
2014/02/06 21:04:12
Ok, removed.
| |
| 32 } | |
| 33 return new_mode; | |
| 34 } | |
| 35 | |
| 36 } // namespace content | |
| OLD | NEW |