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 "content/browser/accessibility/accessibility_mode_helper.h" | |
| 6 | |
| 7 namespace content { | |
| 8 | |
| 9 unsigned int AddAccessibilityMode(unsigned int to, | |
| 10 AccessibilityMode mode_to_add) { | |
| 11 return to | mode_to_add; | |
|
David Tseng
2014/02/04 20:25:51
Do we want to enforce which modes can be set at th
aboxhall
2014/02/05 16:02:47
I think editable text only overrides the other mod
| |
| 12 } | |
| 13 | |
| 14 unsigned int RemoveAccessibilityMode(unsigned int from, | |
| 15 AccessibilityMode mode_to_remove) { | |
| 16 if (!(mode_to_remove & AccessibilityModeFlagRenderer)) | |
| 17 return from ^ (mode_to_remove & from); | |
| 18 | |
| 19 unsigned int to_remove = mode_to_remove; | |
| 20 | |
| 21 // AccessibilityModeFlagPlatform depends on AccessibilityModeFlagRenderer; | |
| 22 // don't turn off the latter if the former will remain on. | |
| 23 if (!(mode_to_remove & AccessibilityModeFlagPlatform) && | |
| 24 (from & AccessibilityModeFlagPlatform)) { | |
| 25 to_remove ^= AccessibilityModeFlagRenderer; | |
| 26 } | |
| 27 | |
| 28 return from ^ (to_remove & from); | |
| 29 } | |
| 30 | |
| 31 } // namespace content | |
| OLD | NEW |