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

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

Issue 2121004: Windows accessibility improvements: 1. All WebKit roles are now passed to the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/l10n_util_win.h" 8 #include "app/l10n_util_win.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 return MA_NOACTIVATE; 1473 return MA_NOACTIVATE;
1474 } 1474 }
1475 } 1475 }
1476 handled = FALSE; 1476 handled = FALSE;
1477 return MA_ACTIVATE; 1477 return MA_ACTIVATE;
1478 } 1478 }
1479 1479
1480 void RenderWidgetHostViewWin::UpdateAccessibilityTree( 1480 void RenderWidgetHostViewWin::UpdateAccessibilityTree(
1481 const webkit_glue::WebAccessibility& tree) { 1481 const webkit_glue::WebAccessibility& tree) {
1482 browser_accessibility_manager_.reset( 1482 browser_accessibility_manager_.reset(
1483 new BrowserAccessibilityManager(m_hWnd, tree)); 1483 new BrowserAccessibilityManager(m_hWnd, tree, this));
1484 } 1484 }
1485 1485
1486 void RenderWidgetHostViewWin::OnAccessibilityFocusChange(int acc_obj_id) { 1486 void RenderWidgetHostViewWin::OnAccessibilityFocusChange(int acc_obj_id) {
1487 if (browser_accessibility_manager_.get()) { 1487 if (browser_accessibility_manager_.get()) {
1488 browser_accessibility_manager_->OnAccessibilityFocusChange(acc_obj_id); 1488 browser_accessibility_manager_->OnAccessibilityFocusChange(acc_obj_id);
1489 } 1489 }
1490 } 1490 }
1491 1491
1492 void RenderWidgetHostViewWin::OnAccessibilityObjectStateChange(int acc_obj_id) { 1492 void RenderWidgetHostViewWin::OnAccessibilityObjectStateChange(int acc_obj_id) {
1493 if (browser_accessibility_manager_.get()) { 1493 if (browser_accessibility_manager_.get()) {
(...skipping 15 matching lines...) Expand all
1509 if (!render_widget_host_ || 1509 if (!render_widget_host_ ||
1510 render_process_host != render_widget_host_->process()) 1510 render_process_host != render_widget_host_->process())
1511 return; 1511 return;
1512 1512
1513 // If it was our RenderProcessHost that posted the notification, 1513 // If it was our RenderProcessHost that posted the notification,
1514 // clear the BrowserAccessibilityManager, because the renderer is 1514 // clear the BrowserAccessibilityManager, because the renderer is
1515 // dead and any accessibility information we have is now stale. 1515 // dead and any accessibility information we have is now stale.
1516 browser_accessibility_manager_.reset(NULL); 1516 browser_accessibility_manager_.reset(NULL);
1517 } 1517 }
1518 1518
1519 void RenderWidgetHostViewWin::SetAccessibilityFocus(int acc_obj_id) {
1520 if (!browser_accessibility_manager_.get() ||
1521 !render_widget_host_ ||
1522 !render_widget_host_->process() ||
1523 !render_widget_host_->process()->HasConnection()) {
1524 return;
1525 }
1526
1527 render_widget_host_->SetAccessibilityFocus(acc_obj_id);
1528 }
1529
1530 void RenderWidgetHostViewWin::AccessibilityDoDefaultAction(int acc_obj_id) {
1531 if (!browser_accessibility_manager_.get() ||
1532 !render_widget_host_ ||
1533 !render_widget_host_->process() ||
1534 !render_widget_host_->process()->HasConnection()) {
1535 return;
1536 }
1537
1538 render_widget_host_->AccessibilityDoDefaultAction(acc_obj_id);
1539 }
1540
1519 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam, 1541 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam,
1520 LPARAM lparam, BOOL& handled) { 1542 LPARAM lparam, BOOL& handled) {
1521 // TODO(dmazzoni): http://crbug.com/25564 Disabling accessibility in the 1543 // TODO(dmazzoni): http://crbug.com/25564 Disabling accessibility in the
1522 // renderer is a temporary work-around until that bug is fixed. 1544 // renderer is a temporary work-around until that bug is fixed.
1523 if (!renderer_accessible_) { 1545 if (!renderer_accessible_) {
1524 handled = false; 1546 handled = false;
1525 return static_cast<LRESULT>(0L); 1547 return static_cast<LRESULT>(0L);
1526 } 1548 }
1527 1549
1528 if (lparam == OBJID_CLIENT && browser_accessibility_manager_.get()) { 1550 if (lparam == OBJID_CLIENT && browser_accessibility_manager_.get()) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( 1679 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView(
1658 gfx::NativeView native_view) { 1680 gfx::NativeView native_view) {
1659 if (::IsWindow(native_view)) { 1681 if (::IsWindow(native_view)) {
1660 HANDLE raw_render_host_view = ::GetProp(native_view, 1682 HANDLE raw_render_host_view = ::GetProp(native_view,
1661 kRenderWidgetHostViewKey); 1683 kRenderWidgetHostViewKey);
1662 if (raw_render_host_view) 1684 if (raw_render_host_view)
1663 return reinterpret_cast<RenderWidgetHostView*>(raw_render_host_view); 1685 return reinterpret_cast<RenderWidgetHostView*>(raw_render_host_view);
1664 } 1686 }
1665 return NULL; 1687 return NULL;
1666 } 1688 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698