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

Side by Side Diff: content/browser/renderer_host/legacy_render_widget_host_win.cc

Issue 2879623003: Fixed crash in accessibility code in LegacyRenderWidgetHost. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 "content/browser/renderer_host/legacy_render_widget_host_win.h" 5 #include "content/browser/renderer_host/legacy_render_widget_host_win.h"
6 6
7 #include <objbase.h> 7 #include <objbase.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return static_cast<LRESULT>(0L); 175 return static_cast<LRESULT>(0L);
176 176
177 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From( 177 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(
178 host_->GetRenderWidgetHost()); 178 host_->GetRenderWidgetHost());
179 if (!rwhi) 179 if (!rwhi)
180 return static_cast<LRESULT>(0L); 180 return static_cast<LRESULT>(0L);
181 181
182 BrowserAccessibilityManagerWin* manager = 182 BrowserAccessibilityManagerWin* manager =
183 static_cast<BrowserAccessibilityManagerWin*>( 183 static_cast<BrowserAccessibilityManagerWin*>(
184 rwhi->GetRootBrowserAccessibilityManager()); 184 rwhi->GetRootBrowserAccessibilityManager());
185 if (!manager) 185 if (!manager || !manager->GetRoot())
186 return static_cast<LRESULT>(0L); 186 return static_cast<LRESULT>(0L);
187 187
188 base::win::ScopedComPtr<IAccessible> root( 188 base::win::ScopedComPtr<IAccessible> root(
189 ToBrowserAccessibilityWin(manager->GetRoot())->GetCOM()); 189 ToBrowserAccessibilityWin(manager->GetRoot())->GetCOM());
190 return LresultFromObject(IID_IAccessible, w_param, 190 return LresultFromObject(IID_IAccessible, w_param,
191 static_cast<IAccessible*>(root.Detach())); 191 static_cast<IAccessible*>(root.Detach()));
192 } 192 }
193 193
194 // We send keyboard/mouse/touch messages to the parent window via SendMessage. 194 // We send keyboard/mouse/touch messages to the parent window via SendMessage.
195 // While this works, this has the side effect of converting input messages into 195 // While this works, this has the side effect of converting input messages into
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 direct_manipulation_helper_->Activate(hwnd()); 422 direct_manipulation_helper_->Activate(hwnd());
423 } else if (window_pos->flags & SWP_HIDEWINDOW) { 423 } else if (window_pos->flags & SWP_HIDEWINDOW) {
424 direct_manipulation_helper_->Deactivate(hwnd()); 424 direct_manipulation_helper_->Deactivate(hwnd());
425 } 425 }
426 } 426 }
427 SetMsgHandled(FALSE); 427 SetMsgHandled(FALSE);
428 return 0; 428 return 0;
429 } 429 }
430 430
431 } // namespace content 431 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698