Upstream version 6.35.121.0
[platform/framework/web/crosswalk.git] / src / content / common / view_message_enums.h
1 // Copyright (c) 2012 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 #ifndef CONTENT_COMMON_VIEW_MESSAGES_ENUMS_H_
6 #define CONTENT_COMMON_VIEW_MESSAGES_ENUMS_H_
7
8 #include "ipc/ipc_message_macros.h"
9
10 // Values that may be OR'd together to form the 'flags' parameter of a
11 // ViewHostMsg_UpdateRect_Params structure.
12 struct ViewHostMsg_UpdateRect_Flags {
13   enum {
14     IS_RESIZE_ACK = 1 << 0,
15     IS_RESTORE_ACK = 1 << 1,
16     IS_REPAINT_ACK = 1 << 2,
17   };
18   static bool is_resize_ack(int flags) {
19     return (flags & IS_RESIZE_ACK) != 0;
20   }
21   static bool is_restore_ack(int flags) {
22     return (flags & IS_RESTORE_ACK) != 0;
23   }
24   static bool is_repaint_ack(int flags) {
25     return (flags & IS_REPAINT_ACK) != 0;
26   }
27 };
28
29 // Note: keep enums in content/browser/resources/accessibility/accessibility.js
30 // in sync with these two enums.
31 enum AccessibilityModeFlag {
32   // Accessibility updates are processed to create platform trees and events are
33   // passed to platform APIs in the browser.
34   AccessibilityModeFlagPlatform = 1 << 0,
35
36   // Accessibility is on, and the full tree is computed. If this flag is off,
37   // only limited information about editable text nodes is sent to the browser
38   // process. Useful for implementing limited UIA on tablets.
39   AccessibilityModeFlagFullTree = 1 << 1,
40 };
41
42 enum AccessibilityMode {
43   // All accessibility is off.
44   AccessibilityModeOff = 0,
45
46   // Renderer accessibility is on, platform APIs are called, but only limited
47   // information is available (see AccessibilityModeFlagEditableTextOnly).
48   AccessibilityModeEditableTextOnly = AccessibilityModeFlagPlatform,
49
50   // Renderer accessibility is on, and platform APIs are called.
51   AccessibilityModeComplete =
52       AccessibilityModeFlagPlatform | AccessibilityModeFlagFullTree,
53
54   // Renderer accessibility is on, and events are passed to any extensions
55   // requesting automation, but not to platform accessibility.
56   AccessibilityModeTreeOnly = AccessibilityModeFlagFullTree,
57 };
58
59 #endif  // CONTENT_COMMON_VIEW_MESSAGES_ENUMS_H_