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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 115374: Adds propagation and handling of render-side focus events, for the benefit of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/render_widget_host_view_win.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_win.cc (revision 16095)
+++ chrome/browser/renderer_host/render_widget_host_view_win.cc (working copy)
@@ -13,7 +13,6 @@
#include "base/gfx/rect.h"
#include "base/histogram.h"
#include "base/win_util.h"
-#include "chrome/browser/browser_accessibility.h"
#include "chrome/browser/browser_accessibility_manager.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_trial.h"
@@ -685,7 +684,7 @@
TrackMouseLeave(false);
#ifdef ENABLE_TRACK_HWND_DESTRUCTION
TRACK_HWND_DESTRUCTION(m_hWnd);
-#endif // ENABLE_TRACK_HWND_DESTRUCTION
+#endif // ENABLE_TRACK_HWND_DESTRUCTION
}
void RenderWidgetHostViewWin::OnPaint(HDC dc) {
@@ -1194,41 +1193,23 @@
// If our MSAA DOM root is already created, reuse that pointer. Otherwise,
// create a new one.
if (!browser_accessibility_root_) {
- CComObject<BrowserAccessibility>* accessibility = NULL;
+ // Create a new instance of IAccessible. Root id is always 0.
+ BrowserAccessibilityManager::GetInstance()->
+ CreateAccessibilityInstance(IID_IAccessible, 0,
+ render_widget_host_->routing_id(),
+ render_widget_host_->process()->pid(),
+ m_hWnd, reinterpret_cast<void **>
+ (&browser_accessibility_root_));
- if (!SUCCEEDED(CComObject<BrowserAccessibility>::CreateInstance(
- &accessibility)) || !accessibility) {
- // Return with failure.
- return static_cast<LRESULT>(0L);
- }
-
- CComPtr<IAccessible> accessibility_comptr(accessibility);
-
- // Root id is always 0, to distinguish this particular instance when
- // mapping to the render-side IAccessible.
- accessibility->set_iaccessible_id(0);
-
- // Set the unique member variables of this particular process.
- accessibility->set_instance_id(
- BrowserAccessibilityManager::GetInstance()->
- SetMembers(accessibility, m_hWnd, render_widget_host_));
-
- // All is well, assign the temp instance to the class smart pointer.
- browser_accessibility_root_.Attach(accessibility_comptr.Detach());
-
if (!browser_accessibility_root_) {
- // Paranoia check. Return with failure.
+ // No valid root found, return with failure.
NOTREACHED();
return static_cast<LRESULT>(0L);
}
-
- // Notify that an instance of IAccessible was allocated for m_hWnd.
- ::NotifyWinEvent(EVENT_OBJECT_CREATE, m_hWnd, OBJID_CLIENT,
- CHILDID_SELF);
}
- // Create a reference to ViewAccessibility that MSAA will marshall
- // to the client.
+ // Create a reference to BrowserAccessibility which MSAA will marshall to
+ // the client.
reference_result = LresultFromObject(IID_IAccessible, wparam,
static_cast<IAccessible*>(browser_accessibility_root_));
}

Powered by Google App Engine
This is Rietveld 408576698