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

Side by Side Diff: webkit/glue/glue_accessibility_object.h

Issue 115374: Adds propagation and handling of render-side focus events, for the benefit of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_GLUE_GLUE_ACCESSIBILITY_OBJECT_H_ 5 #ifndef WEBKIT_GLUE_GLUE_ACCESSIBILITY_OBJECT_H_
6 #define WEBKIT_GLUE_GLUE_ACCESSIBILITY_OBJECT_H_ 6 #define WEBKIT_GLUE_GLUE_ACCESSIBILITY_OBJECT_H_
7 7
8 #include "AccessibilityObjectWrapper.h" 8 #include "AccessibilityObjectWrapper.h"
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "webkit/glue/webaccessibility.h" 11 #include "webkit/glue/webaccessibility.h"
12 12
13 namespace WebCore { 13 namespace WebCore {
14 class AccessibilityObject; 14 class AccessibilityObject;
15 enum AccessibilityRole; 15 enum AccessibilityRole;
16 } 16 }
17 17
18 //////////////////////////////////////////////////////////////////////////////// 18 ////////////////////////////////////////////////////////////////////////////////
19 // 19 //
20 // GlueAccessibilityObject 20 // GlueAccessibilityObject
21 // 21 //
22 // Operations that access the underlying WebKit DOM directly, exposing 22 // Operations that access the underlying WebKit DOM directly, exposing
23 // accessibility information to the GlueAccessibilityManager. Also provides a 23 // accessibility information to the GlueAccessibilityManager. Also provides a
24 // platform-independent wrapper to WebKit's AccessibilityObject. 24 // platform-independent wrapper to WebKit's AccessibilityObject.
25 //////////////////////////////////////////////////////////////////////////////// 25 ////////////////////////////////////////////////////////////////////////////////
26 class GlueAccessibilityObject : public WebCore::AccessibilityObjectWrapper { 26 class GlueAccessibilityObject : public WebCore::AccessibilityObjectWrapper {
27 public: 27 public:
28 static GlueAccessibilityObject* CreateInstance(WebCore::AccessibilityObject*); 28 static GlueAccessibilityObject* CreateInstance(WebCore::AccessibilityObject*);
29 29
30 virtual ~GlueAccessibilityObject() {}
31
30 // Performs the default action on a given object. 32 // Performs the default action on a given object.
31 bool DoDefaultAction(int child_id); 33 bool DoDefaultAction(int child_id);
32 34
33 // Retrieves the child element or child object at a given point on the screen. 35 // Retrieves the child element or child object at a given point on the screen.
34 GlueAccessibilityObject* HitTest(long x, long y); 36 GlueAccessibilityObject* HitTest(long x, long y);
35 37
36 // Retrieves the specified object's current screen location. 38 // Retrieves the specified object's current screen location.
37 bool Location(long* left, 39 bool Location(long* left,
38 long* top, 40 long* top,
39 long* width, 41 long* width,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 bool Value(int child_id, WebCore::String* value); 86 bool Value(int child_id, WebCore::String* value);
85 87
86 // WebCore::AccessiblityObjectWrapper. 88 // WebCore::AccessiblityObjectWrapper.
87 virtual void detach() { 89 virtual void detach() {
88 if (m_object) 90 if (m_object)
89 m_object = 0; 91 m_object = 0;
90 } 92 }
91 93
92 protected: 94 protected:
93 explicit GlueAccessibilityObject(WebCore::AccessibilityObject*); 95 explicit GlueAccessibilityObject(WebCore::AccessibilityObject*);
94 virtual ~GlueAccessibilityObject() {}
95 96
96 // Helper functions. 97 // Helper functions.
97 WebCore::String name() const; 98 WebCore::String name() const;
98 WebCore::String value() const; 99 WebCore::String value() const;
99 WebCore::String description() const; 100 WebCore::String description() const;
100 webkit_glue::WebAccessibility::Role role() const; 101 webkit_glue::WebAccessibility::Role role() const;
101 102
102 // Retrieves the AccessibilityObject for a given [child_id]. Returns false if 103 // Retrieves the AccessibilityObject for a given [child_id]. Returns false if
103 // [child_id] is less than 0, or if no valid AccessibilityObject is found. 104 // [child_id] is less than 0, or if no valid AccessibilityObject is found.
104 // A [child_id] of 0 is treated as referring to the current object itself. 105 // A [child_id] of 0 is treated as referring to the current object itself.
105 bool GetAccessibilityObjectForChild(int child_id, 106 bool GetAccessibilityObjectForChild(int child_id,
106 WebCore::AccessibilityObject*&) const; 107 WebCore::AccessibilityObject*&) const;
107 108
108 // Wraps the given AccessibilityObject in a GlueAccessibilityObject and 109 // Wraps the given AccessibilityObject in a GlueAccessibilityObject and
109 // returns it. If the AccessibilityObject already has a wrapper assigned, that 110 // returns it. If the AccessibilityObject already has a wrapper assigned, that
110 // one is returned. Otherwise, a new instance of GlueAccessibilityObject is 111 // one is returned. Otherwise, a new instance of GlueAccessibilityObject is
111 // created and assigned as the wrapper. 112 // created and assigned as the wrapper.
112 static GlueAccessibilityObject* ToWrapper(WebCore::AccessibilityObject*); 113 static GlueAccessibilityObject* ToWrapper(WebCore::AccessibilityObject*);
113 114
114 private: 115 private:
115 DISALLOW_COPY_AND_ASSIGN(GlueAccessibilityObject); 116 DISALLOW_COPY_AND_ASSIGN(GlueAccessibilityObject);
116 }; 117 };
117 118
118 #endif // WEBKIT_GLUE_GLUE_ACCESSIBILITY_OBJECT_H_ 119 #endif // WEBKIT_GLUE_GLUE_ACCESSIBILITY_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698