Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: content/browser/accessibility/accessibility_mode_helper.cc

Issue 145283003: Switch AccessibilityMode to be a bitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src@enable
Patch Set: Tweak AccessibilityModeHelperTest Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698