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

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

Issue 261044: Accessibility information from the renderer was not being returned to tools l... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « no previous file | views/accessibility/view_accessibility.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/gdi_util.h" 8 #include "app/gfx/gdi_util.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/l10n_util_win.h" 10 #include "app/l10n_util_win.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/renderer_host/render_widget_host.h" 24 #include "chrome/browser/renderer_host/render_widget_host.h"
25 #include "chrome/common/chrome_constants.h" 25 #include "chrome/common/chrome_constants.h"
26 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "chrome/common/native_web_keyboard_event.h" 27 #include "chrome/common/native_web_keyboard_event.h"
28 #include "chrome/common/plugin_messages.h" 28 #include "chrome/common/plugin_messages.h"
29 #include "chrome/common/render_messages.h" 29 #include "chrome/common/render_messages.h"
30 #include "grit/webkit_resources.h" 30 #include "grit/webkit_resources.h"
31 #include "skia/ext/skia_utils_win.h" 31 #include "skia/ext/skia_utils_win.h"
32 #include "webkit/api/public/WebInputEvent.h" 32 #include "webkit/api/public/WebInputEvent.h"
33 #include "webkit/api/public/win/WebInputEventFactory.h" 33 #include "webkit/api/public/win/WebInputEventFactory.h"
34 #include "views/accessibility/view_accessibility.h"
34 #include "views/focus/focus_util_win.h" 35 #include "views/focus/focus_util_win.h"
35 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! 36 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h!
36 #include "views/widget/widget_win.h" 37 #include "views/widget/widget_win.h"
37 #include "webkit/glue/plugins/plugin_constants_win.h" 38 #include "webkit/glue/plugins/plugin_constants_win.h"
38 #include "webkit/glue/plugins/webplugin_delegate_impl.h" 39 #include "webkit/glue/plugins/webplugin_delegate_impl.h"
39 #include "webkit/glue/webcursor.h" 40 #include "webkit/glue/webcursor.h"
40 41
41 using base::TimeDelta; 42 using base::TimeDelta;
42 using base::TimeTicks; 43 using base::TimeTicks;
43 using WebKit::WebInputEvent; 44 using WebKit::WebInputEvent;
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 /////////////////////////////////////////////////////////////////////////////// 675 ///////////////////////////////////////////////////////////////////////////////
675 // RenderWidgetHostViewWin, private: 676 // RenderWidgetHostViewWin, private:
676 677
677 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { 678 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) {
678 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale 679 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale
679 // of a browser process. 680 // of a browser process.
680 OnInputLangChange(0, 0); 681 OnInputLangChange(0, 0);
681 // Marks that window as supporting mouse-wheel messages rerouting so it is 682 // Marks that window as supporting mouse-wheel messages rerouting so it is
682 // scrolled when under the mouse pointer even if inactive. 683 // scrolled when under the mouse pointer even if inactive.
683 views::SetWindowSupportsRerouteMouseWheel(m_hWnd); 684 views::SetWindowSupportsRerouteMouseWheel(m_hWnd);
685 // Save away our HWND in the parent window as a property so that the
686 // accessibility code can find it.
687 SetProp(GetParent(), kViewsNativeHostPropForAccessibility, m_hWnd);
684 return 0; 688 return 0;
685 } 689 }
686 690
687 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, 691 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized,
688 HWND window) { 692 HWND window) {
689 // If the container is a popup, clicking elsewhere on screen should close the 693 // If the container is a popup, clicking elsewhere on screen should close the
690 // popup. 694 // popup.
691 if (close_on_deactivate_ && action == WA_INACTIVE) { 695 if (close_on_deactivate_ && action == WA_INACTIVE) {
692 // Send a windows message so that any derived classes 696 // Send a windows message so that any derived classes
693 // will get a change to override the default handling 697 // will get a change to override the default handling
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 // conflicts with the ids used by MSAA. 1246 // conflicts with the ids used by MSAA.
1243 BrowserAccessibilityManager::GetInstance()->CreateAccessibilityInstance( 1247 BrowserAccessibilityManager::GetInstance()->CreateAccessibilityInstance(
1244 IID_IAccessible, 1000, 1248 IID_IAccessible, 1000,
1245 render_widget_host_->routing_id(), 1249 render_widget_host_->routing_id(),
1246 render_widget_host_->process()->id(), 1250 render_widget_host_->process()->id(),
1247 m_hWnd, 1251 m_hWnd,
1248 reinterpret_cast<void **>(browser_accessibility_root_.Receive())); 1252 reinterpret_cast<void **>(browser_accessibility_root_.Receive()));
1249 1253
1250 if (!browser_accessibility_root_) { 1254 if (!browser_accessibility_root_) {
1251 // No valid root found, return with failure. 1255 // No valid root found, return with failure.
1252 NOTREACHED();
1253 return static_cast<LRESULT>(0L); 1256 return static_cast<LRESULT>(0L);
1254 } 1257 }
1255 } 1258 }
1256 1259
1257 // Create a reference to BrowserAccessibility which MSAA will marshall to 1260 // Create a reference to BrowserAccessibility which MSAA will marshall to
1258 // the client. 1261 // the client.
1259 reference_result = LresultFromObject(IID_IAccessible, wparam, 1262 reference_result = LresultFromObject(IID_IAccessible, wparam,
1260 static_cast<IAccessible*>(browser_accessibility_root_)); 1263 static_cast<IAccessible*>(browser_accessibility_root_));
1261 } 1264 }
1262 return reference_result; 1265 return reference_result;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 // WM_LBUTTONDOWN. 1349 // WM_LBUTTONDOWN.
1347 SetFocus(); 1350 SetFocus();
1348 } 1351 }
1349 } 1352 }
1350 1353
1351 void RenderWidgetHostViewWin::ShutdownHost() { 1354 void RenderWidgetHostViewWin::ShutdownHost() {
1352 shutdown_factory_.RevokeAll(); 1355 shutdown_factory_.RevokeAll();
1353 render_widget_host_->Shutdown(); 1356 render_widget_host_->Shutdown();
1354 // Do not touch any members at this point, |this| has been deleted. 1357 // Do not touch any members at this point, |this| has been deleted.
1355 } 1358 }
OLDNEW
« no previous file with comments | « no previous file | views/accessibility/view_accessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698