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/view_messages.h" | 6 #include "content/common/view_messages.h" |
7 #include "content/public/common/content_switches.h" | 7 #include "content/public/common/content_switches.h" |
8 #include "content/renderer/render_view_impl.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" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 const WebAccessibilityObject& obj, | 156 const WebAccessibilityObject& obj, |
157 WebAccessibilityNotification notification) { | 157 WebAccessibilityNotification notification) { |
158 if (!WebAccessibilityObject::accessibilityEnabled()) | 158 if (!WebAccessibilityObject::accessibilityEnabled()) |
159 return; | 159 return; |
160 | 160 |
161 const WebDocument& document = GetMainDocument(); | 161 const WebDocument& document = GetMainDocument(); |
162 if (document.isNull()) | 162 if (document.isNull()) |
163 return; | 163 return; |
164 | 164 |
165 gfx::Size scroll_offset = document.frame()->scrollOffset(); | 165 gfx::Size scroll_offset = document.frame()->scrollOffset(); |
166 if (scroll_offset != last_scroll_offset_) { | 166 if (scroll_offset != last_scroll_offset_ && |
167 notification != WebKit::WebAccessibilityNotificationLayoutComplete) { | |
167 // Make sure the browser is always aware of the scroll position of | 168 // Make sure the browser is always aware of the scroll position of |
168 // the root document element by posting a generic notification that | 169 // the root document element by posting a generic notification that |
169 // will update it. | 170 // will update it. |
170 // TODO(dmazzoni): remove this as soon as | 171 // TODO(dmazzoni): remove this as soon as |
171 // https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed. | 172 // https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed. |
172 last_scroll_offset_ = scroll_offset; | 173 last_scroll_offset_ = scroll_offset; |
173 PostAccessibilityNotification( | 174 PostAccessibilityNotification( |
David Tseng
2011/12/15 02:03:59
I think we should add the exclusion here as the pr
ananta
2011/12/15 02:09:56
Done.
| |
174 document.accessibilityObject(), | 175 document.accessibilityObject(), |
175 WebKit::WebAccessibilityNotificationLayoutComplete); | 176 WebKit::WebAccessibilityNotificationLayoutComplete); |
176 } | 177 } |
177 | 178 |
178 // Add the accessibility object to our cache and ensure it's valid. | 179 // Add the accessibility object to our cache and ensure it's valid. |
179 Notification acc_notification; | 180 Notification acc_notification; |
180 acc_notification.id = obj.axID(); | 181 acc_notification.id = obj.axID(); |
181 acc_notification.type = notification; | 182 acc_notification.type = notification; |
182 | 183 |
183 ViewHostMsg_AccEvent::Value temp; | 184 ViewHostMsg_AccEvent::Value temp; |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
512 | 513 |
513 WebDocument RendererAccessibility::GetMainDocument() { | 514 WebDocument RendererAccessibility::GetMainDocument() { |
514 WebView* view = render_view()->GetWebView(); | 515 WebView* view = render_view()->GetWebView(); |
515 WebFrame* main_frame = view ? view->mainFrame() : NULL; | 516 WebFrame* main_frame = view ? view->mainFrame() : NULL; |
516 | 517 |
517 if (main_frame) | 518 if (main_frame) |
518 return main_frame->document(); | 519 return main_frame->document(); |
519 else | 520 else |
520 return WebDocument(); | 521 return WebDocument(); |
521 } | 522 } |
OLD | NEW |