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 "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 Loading... |
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 | 1431 BrowserAccessibilityManager::CreateEmptyDocument( |
1432 webkit_glue::WebAccessibility empty_document; | 1432 m_hWnd, static_cast<WebAccessibility::State>(0), this); |
1433 empty_document.role = WebAccessibility::ROLE_DOCUMENT; | |
1434 empty_document.state = 0; | |
1435 browser_accessibility_manager_.reset( | |
1436 BrowserAccessibilityManager::Create(m_hWnd, empty_document, this)); | |
1437 } | 1433 } |
1438 | |
1439 browser_accessibility_manager_->OnAccessibilityNotifications(params); | 1434 browser_accessibility_manager_->OnAccessibilityNotifications(params); |
1440 } | 1435 } |
1441 | 1436 |
1442 void RenderWidgetHostViewWin::Observe(int type, | 1437 void RenderWidgetHostViewWin::Observe(int type, |
1443 const NotificationSource& source, | 1438 const NotificationSource& source, |
1444 const NotificationDetails& details) { | 1439 const NotificationDetails& details) { |
1445 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); | 1440 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); |
1446 | 1441 |
1447 // Get the RenderProcessHost that posted this notification, and exit | 1442 // Get the RenderProcessHost that posted this notification, and exit |
1448 // if it's not the one associated with this host view. | 1443 // if it's not the one associated with this host view. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 } | 1599 } |
1605 | 1600 |
1606 IAccessible* RenderWidgetHostViewWin::GetIAccessible() { | 1601 IAccessible* RenderWidgetHostViewWin::GetIAccessible() { |
1607 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) { | 1602 if (render_widget_host_ && !render_widget_host_->renderer_accessible()) { |
1608 // Attempt to detect screen readers by sending an event with our custom id. | 1603 // Attempt to detect screen readers by sending an event with our custom id. |
1609 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); | 1604 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); |
1610 } | 1605 } |
1611 | 1606 |
1612 if (!browser_accessibility_manager_.get()) { | 1607 if (!browser_accessibility_manager_.get()) { |
1613 // Return busy document tree while renderer accessibility tree loads. | 1608 // Return busy document tree while renderer accessibility tree loads. |
1614 webkit_glue::WebAccessibility loading_tree; | 1609 BrowserAccessibilityManager::CreateEmptyDocument( |
1615 loading_tree.role = WebAccessibility::ROLE_DOCUMENT; | 1610 m_hWnd, (1 << WebAccessibility::STATE_BUSY), this); |
1616 loading_tree.state = (1 << WebAccessibility::STATE_BUSY); | |
1617 browser_accessibility_manager_.reset( | |
1618 BrowserAccessibilityManager::Create(m_hWnd, loading_tree, this)); | |
1619 } | 1611 } |
1620 | 1612 |
1621 return browser_accessibility_manager_->GetRoot()->toBrowserAccessibilityWin(); | 1613 return browser_accessibility_manager_->GetRoot()->toBrowserAccessibilityWin(); |
1622 } | 1614 } |
1623 | 1615 |
1624 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam, | 1616 LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam, |
1625 LPARAM lparam, BOOL& handled) { | 1617 LPARAM lparam, BOOL& handled) { |
1626 if (kIdCustom == lparam) { | 1618 if (kIdCustom == lparam) { |
1627 // An MSAA client requestes our custom id. Assume that we have detected an | 1619 // An MSAA client requestes our custom id. Assume that we have detected an |
1628 // active windows screen reader. | 1620 // active windows screen reader. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1782 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
1791 gfx::NativeView native_view) { | 1783 gfx::NativeView native_view) { |
1792 if (views::Widget::IsPureViews()) { | 1784 if (views::Widget::IsPureViews()) { |
1793 // TODO(beng): Figure out what to do for Windows/v.o.v. | 1785 // TODO(beng): Figure out what to do for Windows/v.o.v. |
1794 return NULL; | 1786 return NULL; |
1795 } | 1787 } |
1796 return ::IsWindow(native_view) ? | 1788 return ::IsWindow(native_view) ? |
1797 reinterpret_cast<RenderWidgetHostView*>( | 1789 reinterpret_cast<RenderWidgetHostView*>( |
1798 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1790 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
1799 } | 1791 } |
OLD | NEW |