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

Side by Side Diff: ui/views/accessibility/native_view_accessibility_win.cc

Issue 23851012: Fix crash when calling get_accChild on empty WebView. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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 | ui/views/accessibility/native_view_accessibility_win_unittest.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/accessibility/native_view_accessibility_win.h" 5 #include "ui/views/accessibility/native_view_accessibility_win.h"
6 6
7 #include <UIAutomationClient.h> 7 #include <UIAutomationClient.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 return accessible; 99 return accessible;
100 } 100 }
101 101
102 // Search all web views. For each one, first ensure it's a descendant 102 // Search all web views. For each one, first ensure it's a descendant
103 // of this view where the event was posted - and if so, see if it owns 103 // of this view where the event was posted - and if so, see if it owns
104 // an accessible object with that child id. If so, save the view to speed 104 // an accessible object with that child id. If so, save the view to speed
105 // up the next notification. 105 // up the next notification.
106 for (std::set<View*>::iterator iter = web_views_.begin(); 106 for (std::set<View*>::iterator iter = web_views_.begin();
107 iter != web_views_.end(); ++iter) { 107 iter != web_views_.end(); ++iter) {
108 View* web_view = *iter; 108 View* web_view = *iter;
109 if (!top_view->Contains(web_view)) 109 if (top_view == web_view || !top_view->Contains(web_view))
110 continue; 110 continue;
111 IAccessible* accessible = AccessibleObjectFromChildId(web_view, child_id); 111 IAccessible* accessible = AccessibleObjectFromChildId(web_view, child_id);
112 if (accessible) { 112 if (accessible) {
113 last_top_view_ = top_view; 113 last_top_view_ = top_view;
114 last_web_view_ = web_view; 114 last_web_view_ = web_view;
115 return accessible; 115 return accessible;
116 } 116 }
117 } 117 }
118 118
119 return NULL; 119 return NULL;
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 LONG start_offset, 1289 LONG start_offset,
1290 ui::TextBoundaryDirection direction) { 1290 ui::TextBoundaryDirection direction) {
1291 HandleSpecialTextOffset(text, &start_offset); 1291 HandleSpecialTextOffset(text, &start_offset);
1292 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 1292 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
1293 std::vector<int32> line_breaks; 1293 std::vector<int32> line_breaks;
1294 return ui::FindAccessibleTextBoundary( 1294 return ui::FindAccessibleTextBoundary(
1295 text, line_breaks, boundary, start_offset, direction); 1295 text, line_breaks, boundary, start_offset, direction);
1296 } 1296 }
1297 1297
1298 } // namespace views 1298 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/accessibility/native_view_accessibility_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698