OLD | NEW |
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 #include <comdef.h> | 5 #include <comdef.h> |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 | 8 |
9 #pragma warning(push, 0) | 9 #pragma warning(push, 0) |
10 #include "AccessibleDocument.h" | 10 #include "AccessibleDocument.h" |
11 #include "AXObjectCache.h" | 11 #include "AXObjectCache.h" |
12 #include "Document.h" | 12 #include "Document.h" |
13 #include "Frame.h" | 13 #include "Frame.h" |
14 #pragma warning(pop) | 14 #pragma warning(pop) |
15 #undef LOG | 15 #undef LOG |
16 | 16 |
17 #include "webkit/glue/glue_accessibility.h" | 17 #include "webkit/glue/glue_accessibility.h" |
18 | 18 |
19 #include "base/ref_counted.h" | 19 #include "base/ref_counted.h" |
20 #include "webkit/glue/webframe_impl.h" | 20 #include "webkit/glue/webframe_impl.h" |
21 #include "webkit/glue/webview_impl.h" | 21 #include "webkit/glue/webview_impl.h" |
22 | 22 |
23 // TODO: Remove this evil dependency on Chrome! | |
24 #include "chrome/browser/iaccessible_function_ids.h" | |
25 | |
26 // struct GlueAccessibility::GlueAccessibilityRoot | 23 // struct GlueAccessibility::GlueAccessibilityRoot |
27 struct GlueAccessibility::GlueAccessibilityRoot { | 24 struct GlueAccessibility::GlueAccessibilityRoot { |
28 GlueAccessibilityRoot() {} | 25 GlueAccessibilityRoot() {} |
29 | 26 |
30 // Root of the WebKit IAccessible tree. | 27 // Root of the WebKit IAccessible tree. |
31 scoped_refptr<AccessibleDocument> accessibility_root_; | 28 scoped_refptr<AccessibleDocument> accessibility_root_; |
32 }; | 29 }; |
33 | 30 |
34 // class GlueAccessibility | 31 // class GlueAccessibility |
35 GlueAccessibility::GlueAccessibility() | 32 GlueAccessibility::GlueAccessibility() |
36 : root_(new GlueAccessibilityRoot) { | 33 : root_(new GlueAccessibilityRoot) { |
37 } | 34 } |
38 | 35 |
39 GlueAccessibility::~GlueAccessibility() { | 36 GlueAccessibility::~GlueAccessibility() { |
40 delete root_; | 37 delete root_; |
41 } | 38 } |
42 | 39 |
43 bool GlueAccessibility::GetAccessibilityInfo(WebView* view, | 40 bool GlueAccessibility::GetAccessibilityInfo(WebView* view, |
44 const ViewMsg_Accessibility_In_Params& in_params, | 41 const AccessibilityInParams& in_params, |
45 ViewHostMsg_Accessibility_Out_Params* out_params) { | 42 AccessibilityOutParams* out_params) { |
46 WebFrame* main_frame = view->GetMainFrame(); | 43 WebFrame* main_frame = view->GetMainFrame(); |
47 if (!main_frame || !static_cast<WebFrameImpl*>(main_frame)->frameview()) | 44 if (!main_frame || !static_cast<WebFrameImpl*>(main_frame)->frameview()) |
48 return false; | 45 return false; |
49 | 46 |
50 if (!root_->accessibility_root_ && !InitAccessibilityRoot(view)) { | 47 if (!root_->accessibility_root_ && !InitAccessibilityRoot(view)) { |
51 // Failure in retrieving the root. | 48 // Failure in retrieving the root. |
52 return false; | 49 return false; |
53 } | 50 } |
54 | 51 |
55 // Temporary storing for the currently active IAccessible. | 52 // Temporary storing for the currently active IAccessible. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 int_to_iaccessible_map_.erase(it); | 271 int_to_iaccessible_map_.erase(it); |
275 | 272 |
276 if (iaccessible_id == 0) { | 273 if (iaccessible_id == 0) { |
277 // Invalidate root. | 274 // Invalidate root. |
278 root_->accessibility_root_ = 0; | 275 root_->accessibility_root_ = 0; |
279 } | 276 } |
280 } | 277 } |
281 | 278 |
282 return true; | 279 return true; |
283 } | 280 } |
OLD | NEW |