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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 7461104: Fix a few lingering bugs in BrowserAccessibilityManager and BrowserAccessibilityCocoa. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revise SPI comment with openradar link. Created 9 years, 4 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) 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 "chrome/browser/renderer_host/render_widget_host_view_win.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 } 1421 }
1422 } 1422 }
1423 handled = FALSE; 1423 handled = FALSE;
1424 render_widget_host_->OnMouseActivate(); 1424 render_widget_host_->OnMouseActivate();
1425 return MA_ACTIVATE; 1425 return MA_ACTIVATE;
1426 } 1426 }
1427 1427
1428 void RenderWidgetHostViewWin::OnAccessibilityNotifications( 1428 void RenderWidgetHostViewWin::OnAccessibilityNotifications(
1429 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { 1429 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) {
1430 if (!browser_accessibility_manager_.get()) { 1430 if (!browser_accessibility_manager_.get()) {
1431 // Use empty document to process notifications
1432 webkit_glue::WebAccessibility empty_document;
1433 empty_document.role = WebAccessibility::ROLE_DOCUMENT;
1434 empty_document.state = 0;
1435 browser_accessibility_manager_.reset( 1431 browser_accessibility_manager_.reset(
1436 BrowserAccessibilityManager::Create(m_hWnd, empty_document, this)); 1432 BrowserAccessibilityManager::CreateEmptyDocument(
1433 m_hWnd, static_cast<WebAccessibility::State>(0), this));
1437 } 1434 }
1438
1439 browser_accessibility_manager_->OnAccessibilityNotifications(params); 1435 browser_accessibility_manager_->OnAccessibilityNotifications(params);
1440 } 1436 }
1441 1437
1442 void RenderWidgetHostViewWin::Observe(int type, 1438 void RenderWidgetHostViewWin::Observe(int type,
1443 const NotificationSource& source, 1439 const NotificationSource& source,
1444 const NotificationDetails& details) { 1440 const NotificationDetails& details) {
1445 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); 1441 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED);
1446 1442
1447 // Get the RenderProcessHost that posted this notification, and exit 1443 // Get the RenderProcessHost that posted this notification, and exit
1448 // if it's not the one associated with this host view. 1444 // if it's not the one associated with this host view.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 } 1600 }
1605 1601
1606 IAccessible* RenderWidgetHostViewWin::GetIAccessible() { 1602 IAccessible* RenderWidgetHostViewWin::GetIAccessible() {
1607 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) { 1603 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) {
1608 // Attempt to detect screen readers by sending an event with our custom id. 1604 // Attempt to detect screen readers by sending an event with our custom id.
1609 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); 1605 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF);
1610 } 1606 }
1611 1607
1612 if (!browser_accessibility_manager_.get()) { 1608 if (!browser_accessibility_manager_.get()) {
1613 // Return busy document tree while renderer accessibility tree loads. 1609 // Return busy document tree while renderer accessibility tree loads.
1614 webkit_glue::WebAccessibility loading_tree;
1615 loading_tree.role = WebAccessibility::ROLE_DOCUMENT;
1616 loading_tree.state = (1 << WebAccessibility::STATE_BUSY);
1617 browser_accessibility_manager_.reset( 1610 browser_accessibility_manager_.reset(
1618 BrowserAccessibilityManager::Create(m_hWnd, loading_tree, this)); 1611 BrowserAccessibilityManager::CreateEmptyDocument(
1612 m_hWnd, (1 << WebAccessibility::STATE_BUSY), this));
1619 } 1613 }
1620 1614
1621 return browser_accessibility_manager_->GetRoot()->toBrowserAccessibilityWin(); 1615 return browser_accessibility_manager_->GetRoot()->toBrowserAccessibilityWin();
1622 } 1616 }
1623 1617
1624 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam, 1618 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam,
1625 LPARAM lparam, BOOL& handled) { 1619 LPARAM lparam, BOOL& handled) {
1626 if (kIdCustom == lparam) { 1620 if (kIdCustom == lparam) {
1627 // An MSAA client requestes our custom id. Assume that we have detected an 1621 // An MSAA client requestes our custom id. Assume that we have detected an
1628 // active windows screen reader. 1622 // active windows screen reader.
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( 1784 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView(
1791 gfx::NativeView native_view) { 1785 gfx::NativeView native_view) {
1792 if (views::Widget::IsPureViews()) { 1786 if (views::Widget::IsPureViews()) {
1793 // TODO(beng): Figure out what to do for Windows/v.o.v. 1787 // TODO(beng): Figure out what to do for Windows/v.o.v.
1794 return NULL; 1788 return NULL;
1795 } 1789 }
1796 return ::IsWindow(native_view) ? 1790 return ::IsWindow(native_view) ?
1797 reinterpret_cast<RenderWidgetHostView*>( 1791 reinterpret_cast<RenderWidgetHostView*>(
1798 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; 1792 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL;
1799 } 1793 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698