OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "content/common/content_switches.h" | 6 #include "content/common/content_switches.h" |
7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
8 #include "content/renderer/render_view.h" | 8 #include "content/renderer/render_view_impl.h" |
9 #include "content/renderer/renderer_accessibility.h" | 9 #include "content/renderer/renderer_accessibility.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
14 #include "webkit/glue/webaccessibility.h" | 14 #include "webkit/glue/webaccessibility.h" |
15 | 15 |
16 using WebKit::WebAccessibilityNotification; | 16 using WebKit::WebAccessibilityNotification; |
17 using WebKit::WebAccessibilityObject; | 17 using WebKit::WebAccessibilityObject; |
18 using WebKit::WebDocument; | 18 using WebKit::WebDocument; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 case WebKit::WebAccessibilityNotificationValueChanged: | 70 case WebKit::WebAccessibilityNotificationValueChanged: |
71 *type = ViewHostMsg_AccEvent::VALUE_CHANGED; | 71 *type = ViewHostMsg_AccEvent::VALUE_CHANGED; |
72 break; | 72 break; |
73 default: | 73 default: |
74 NOTREACHED(); | 74 NOTREACHED(); |
75 return false; | 75 return false; |
76 } | 76 } |
77 return true; | 77 return true; |
78 } | 78 } |
79 | 79 |
80 RendererAccessibility::RendererAccessibility(RenderView* render_view) | 80 RendererAccessibility::RendererAccessibility(RenderViewImpl* render_view) |
81 : content::RenderViewObserver(render_view), | 81 : content::RenderViewObserver(render_view), |
82 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), | 82 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), |
83 browser_root_(NULL), | 83 browser_root_(NULL), |
84 ack_pending_(false), | 84 ack_pending_(false), |
85 logging_(false), | 85 logging_(false), |
86 sent_load_complete_(false) { | 86 sent_load_complete_(false) { |
87 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 87 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
88 if (command_line.HasSwitch(switches::kEnableAccessibility)) | 88 if (command_line.HasSwitch(switches::kEnableAccessibility)) |
89 WebAccessibilityObject::enableAccessibility(); | 89 WebAccessibilityObject::enableAccessibility(); |
90 if (command_line.HasSwitch(switches::kEnableAccessibilityLogging)) | 90 if (command_line.HasSwitch(switches::kEnableAccessibilityLogging)) |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 425 |
426 WebDocument RendererAccessibility::GetMainDocument() { | 426 WebDocument RendererAccessibility::GetMainDocument() { |
427 WebView* view = render_view()->GetWebView(); | 427 WebView* view = render_view()->GetWebView(); |
428 WebFrame* main_frame = view ? view->mainFrame() : NULL; | 428 WebFrame* main_frame = view ? view->mainFrame() : NULL; |
429 | 429 |
430 if (main_frame) | 430 if (main_frame) |
431 return main_frame->document(); | 431 return main_frame->document(); |
432 else | 432 else |
433 return WebDocument(); | 433 return WebDocument(); |
434 } | 434 } |
OLD | NEW |