| OLD | NEW |
| 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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 child_window = ::GetWindow(child_window, GW_CHILD); | 1470 child_window = ::GetWindow(child_window, GW_CHILD); |
| 1471 | 1471 |
| 1472 ::SetFocus(child_window); | 1472 ::SetFocus(child_window); |
| 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( | |
| 1481 const webkit_glue::WebAccessibility& tree) { | |
| 1482 browser_accessibility_manager_.reset( | |
| 1483 new BrowserAccessibilityManager(m_hWnd, tree, this)); | |
| 1484 | |
| 1485 BrowserAccessibility* root = browser_accessibility_manager_.get()->GetRoot(); | |
| 1486 LONG root_id; | |
| 1487 if (root && SUCCEEDED(root->get_uniqueID(&root_id))) { | |
| 1488 ::NotifyWinEvent( | |
| 1489 EVENT_OBJECT_FOCUS, m_hWnd, OBJID_CLIENT, root_id); | |
| 1490 ::NotifyWinEvent( | |
| 1491 IA2_EVENT_DOCUMENT_LOAD_COMPLETE, m_hWnd, OBJID_CLIENT, root_id); | |
| 1492 } | |
| 1493 } | |
| 1494 | |
| 1495 void RenderWidgetHostViewWin::OnAccessibilityFocusChange(int acc_obj_id) { | |
| 1496 if (browser_accessibility_manager_.get()) { | |
| 1497 browser_accessibility_manager_->OnAccessibilityFocusChange(acc_obj_id); | |
| 1498 } | |
| 1499 } | |
| 1500 | |
| 1501 void RenderWidgetHostViewWin::OnAccessibilityNotifications( | 1480 void RenderWidgetHostViewWin::OnAccessibilityNotifications( |
| 1502 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { | 1481 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { |
| 1503 if (browser_accessibility_manager_.get()) | 1482 if (!browser_accessibility_manager_.get()) { |
| 1504 browser_accessibility_manager_->OnAccessibilityNotifications(params); | 1483 // Use empty document to process notifications |
| 1484 webkit_glue::WebAccessibility empty_document; |
| 1485 empty_document.role = WebAccessibility::ROLE_DOCUMENT; |
| 1486 empty_document.state = 0; |
| 1487 browser_accessibility_manager_.reset( |
| 1488 new BrowserAccessibilityManager(m_hWnd, empty_document, this)); |
| 1489 } |
| 1490 |
| 1491 browser_accessibility_manager_->OnAccessibilityNotifications(params); |
| 1505 } | 1492 } |
| 1506 | 1493 |
| 1507 void RenderWidgetHostViewWin::Observe(NotificationType type, | 1494 void RenderWidgetHostViewWin::Observe(NotificationType type, |
| 1508 const NotificationSource& source, | 1495 const NotificationSource& source, |
| 1509 const NotificationDetails& details) { | 1496 const NotificationDetails& details) { |
| 1510 DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED); | 1497 DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED); |
| 1511 | 1498 |
| 1512 // Get the RenderProcessHost that posted this notification, and exit | 1499 // Get the RenderProcessHost that posted this notification, and exit |
| 1513 // if it's not the one associated with this host view. | 1500 // if it's not the one associated with this host view. |
| 1514 RenderProcessHost* render_process_host = | 1501 RenderProcessHost* render_process_host = |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1685 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 1699 gfx::NativeView native_view) { | 1686 gfx::NativeView native_view) { |
| 1700 if (::IsWindow(native_view)) { | 1687 if (::IsWindow(native_view)) { |
| 1701 HANDLE raw_render_host_view = ::GetProp(native_view, | 1688 HANDLE raw_render_host_view = ::GetProp(native_view, |
| 1702 kRenderWidgetHostViewKey); | 1689 kRenderWidgetHostViewKey); |
| 1703 if (raw_render_host_view) | 1690 if (raw_render_host_view) |
| 1704 return reinterpret_cast<RenderWidgetHostView*>(raw_render_host_view); | 1691 return reinterpret_cast<RenderWidgetHostView*>(raw_render_host_view); |
| 1705 } | 1692 } |
| 1706 return NULL; | 1693 return NULL; |
| 1707 } | 1694 } |
| OLD | NEW |