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

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: Fix corner case with removal of renderer to child id mappings. 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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 handled = FALSE; 1437 handled = FALSE;
1438 render_widget_host_->OnMouseActivate(); 1438 render_widget_host_->OnMouseActivate();
1439 return MA_ACTIVATE; 1439 return MA_ACTIVATE;
1440 } 1440 }
1441 1441
1442 void RenderWidgetHostViewWin::OnAccessibilityNotifications( 1442 void RenderWidgetHostViewWin::OnAccessibilityNotifications(
1443 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { 1443 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) {
1444 if (!browser_accessibility_manager_.get()) { 1444 if (!browser_accessibility_manager_.get()) {
1445 // Use empty document to process notifications 1445 // Use empty document to process notifications
1446 webkit_glue::WebAccessibility empty_document; 1446 webkit_glue::WebAccessibility empty_document;
1447 empty_document.role = WebAccessibility::ROLE_DOCUMENT; 1447 // Renderer id's always start at 1000 as determined by webkit. Boot strap
1448 // our ability to reuse BrowserAccessibility instances.
1449 empty_document.id = 1000;
1450 empty_document.role = WebAccessibility::ROLE_WEB_AREA;
1448 empty_document.state = 0; 1451 empty_document.state = 0;
1449 browser_accessibility_manager_.reset( 1452 browser_accessibility_manager_.reset(
1450 BrowserAccessibilityManager::Create(m_hWnd, empty_document, this)); 1453 BrowserAccessibilityManager::Create(m_hWnd, empty_document, this));
1451 } 1454 }
1452 1455
1453 browser_accessibility_manager_->OnAccessibilityNotifications(params); 1456 browser_accessibility_manager_->OnAccessibilityNotifications(params);
1454 } 1457 }
1455 1458
1456 void RenderWidgetHostViewWin::Observe(int type, 1459 void RenderWidgetHostViewWin::Observe(int type,
1457 const NotificationSource& source, 1460 const NotificationSource& source,
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 1622
1620 IAccessible* RenderWidgetHostViewWin::GetIAccessible() { 1623 IAccessible* RenderWidgetHostViewWin::GetIAccessible() {
1621 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) { 1624 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) {
1622 // Attempt to detect screen readers by sending an event with our custom id. 1625 // Attempt to detect screen readers by sending an event with our custom id.
1623 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); 1626 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF);
1624 } 1627 }
1625 1628
1626 if (!browser_accessibility_manager_.get()) { 1629 if (!browser_accessibility_manager_.get()) {
1627 // Return busy document tree while renderer accessibility tree loads. 1630 // Return busy document tree while renderer accessibility tree loads.
1628 webkit_glue::WebAccessibility loading_tree; 1631 webkit_glue::WebAccessibility loading_tree;
1629 loading_tree.role = WebAccessibility::ROLE_DOCUMENT; 1632 loading_tree.id = 1000;
1633 loading_tree.role = WebAccessibility::ROLE_WEB_AREA;
1630 loading_tree.state = (1 << WebAccessibility::STATE_BUSY); 1634 loading_tree.state = (1 << WebAccessibility::STATE_BUSY);
1631 browser_accessibility_manager_.reset( 1635 browser_accessibility_manager_.reset(
1632 BrowserAccessibilityManager::Create(m_hWnd, loading_tree, this)); 1636 BrowserAccessibilityManager::Create(m_hWnd, loading_tree, this));
1633 } 1637 }
1634 1638
1635 return browser_accessibility_manager_->GetRoot()->toBrowserAccessibilityWin(); 1639 return browser_accessibility_manager_->GetRoot()->toBrowserAccessibilityWin();
1636 } 1640 }
1637 1641
1638 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam, 1642 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam,
1639 LPARAM lparam, BOOL& handled) { 1643 LPARAM lparam, BOOL& handled) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 DWORD ex_style) { 1821 DWORD ex_style) {
1818 parent_hwnd_ = parent_hwnd; 1822 parent_hwnd_ = parent_hwnd;
1819 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style); 1823 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style);
1820 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE); 1824 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE);
1821 // To show tooltip on popup window.(e.g. title in <select>) 1825 // To show tooltip on popup window.(e.g. title in <select>)
1822 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked. 1826 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked.
1823 // Ensure the tooltip is created otherwise tooltips are never shown. 1827 // Ensure the tooltip is created otherwise tooltips are never shown.
1824 EnsureTooltip(); 1828 EnsureTooltip();
1825 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA); 1829 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA);
1826 } 1830 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698