| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Make sure the browser is always aware of the scroll position of | 167 // Make sure the browser is always aware of the scroll position of |
| 168 // the root document element by posting a generic notification that | 168 // the root document element by posting a generic notification that |
| 169 // will update it. | 169 // will update it. |
| 170 // TODO(dmazzoni): remove this as soon as | 170 // TODO(dmazzoni): remove this as soon as |
| 171 // https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed. | 171 // https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed. |
| 172 last_scroll_offset_ = scroll_offset; | 172 last_scroll_offset_ = scroll_offset; |
| 173 PostAccessibilityNotification( | 173 if (notification != WebKit::WebAccessibilityNotificationLayoutComplete) { |
| 174 document.accessibilityObject(), | 174 PostAccessibilityNotification( |
| 175 WebKit::WebAccessibilityNotificationLayoutComplete); | 175 document.accessibilityObject(), |
| 176 WebKit::WebAccessibilityNotificationLayoutComplete); |
| 177 } |
| 176 } | 178 } |
| 177 | 179 |
| 178 // Add the accessibility object to our cache and ensure it's valid. | 180 // Add the accessibility object to our cache and ensure it's valid. |
| 179 Notification acc_notification; | 181 Notification acc_notification; |
| 180 acc_notification.id = obj.axID(); | 182 acc_notification.id = obj.axID(); |
| 181 acc_notification.type = notification; | 183 acc_notification.type = notification; |
| 182 | 184 |
| 183 ViewHostMsg_AccEvent::Value temp; | 185 ViewHostMsg_AccEvent::Value temp; |
| 184 if (!WebAccessibilityNotificationToViewHostMsg(notification, &temp)) | 186 if (!WebAccessibilityNotificationToViewHostMsg(notification, &temp)) |
| 185 return; | 187 return; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 514 |
| 513 WebDocument RendererAccessibility::GetMainDocument() { | 515 WebDocument RendererAccessibility::GetMainDocument() { |
| 514 WebView* view = render_view()->GetWebView(); | 516 WebView* view = render_view()->GetWebView(); |
| 515 WebFrame* main_frame = view ? view->mainFrame() : NULL; | 517 WebFrame* main_frame = view ? view->mainFrame() : NULL; |
| 516 | 518 |
| 517 if (main_frame) | 519 if (main_frame) |
| 518 return main_frame->document(); | 520 return main_frame->document(); |
| 519 else | 521 else |
| 520 return WebDocument(); | 522 return WebDocument(); |
| 521 } | 523 } |
| OLD | NEW |