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

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

Issue 8467002: Fix double-initialization of CComModule. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « ui/ui.gyp ('k') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "third_party/iaccessible2/ia2_api_all.h" 12 #include "third_party/iaccessible2/ia2_api_all.h"
13 #include "ui/base/accessibility/accessible_text_utils.h" 13 #include "ui/base/accessibility/accessible_text_utils.h"
14 #include "ui/base/accessibility/accessible_view_state.h" 14 #include "ui/base/accessibility/accessible_view_state.h"
15 #include "ui/base/view_prop.h" 15 #include "ui/base/view_prop.h"
16 #include "ui/base/win/atl_module.h"
16 #include "views/widget/native_widget_win.h" 17 #include "views/widget/native_widget_win.h"
17 #include "views/widget/widget.h" 18 #include "views/widget/widget.h"
18 19
19 using ui::AccessibilityTypes; 20 using ui::AccessibilityTypes;
20 21
21 // static 22 // static
22 long NativeViewAccessibilityWin::next_unique_id_ = 1; 23 long NativeViewAccessibilityWin::next_unique_id_ = 1;
23 24
24 // static 25 // static
25 scoped_refptr<NativeViewAccessibilityWin> NativeViewAccessibilityWin::Create( 26 scoped_refptr<NativeViewAccessibilityWin> NativeViewAccessibilityWin::Create(
26 views::View* view) { 27 views::View* view) {
28 // Make sure ATL is initialized in this module.
29 ui::win::CreateATLModuleIfNeeded();
30
27 CComObject<NativeViewAccessibilityWin>* instance = NULL; 31 CComObject<NativeViewAccessibilityWin>* instance = NULL;
28 HRESULT hr = CComObject<NativeViewAccessibilityWin>::CreateInstance( 32 HRESULT hr = CComObject<NativeViewAccessibilityWin>::CreateInstance(
29 &instance); 33 &instance);
30 DCHECK(SUCCEEDED(hr)); 34 DCHECK(SUCCEEDED(hr));
31 instance->set_view(view); 35 instance->set_view(view);
32 return scoped_refptr<NativeViewAccessibilityWin>(instance); 36 return scoped_refptr<NativeViewAccessibilityWin>(instance);
33 } 37 }
34 38
35 NativeViewAccessibilityWin::NativeViewAccessibilityWin() 39 NativeViewAccessibilityWin::NativeViewAccessibilityWin()
36 : view_(NULL), 40 : view_(NULL),
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 const string16& text, 1025 const string16& text,
1022 IA2TextBoundaryType ia2_boundary, 1026 IA2TextBoundaryType ia2_boundary,
1023 LONG start_offset, 1027 LONG start_offset,
1024 ui::TextBoundaryDirection direction) { 1028 ui::TextBoundaryDirection direction) {
1025 HandleSpecialTextOffset(text, &start_offset); 1029 HandleSpecialTextOffset(text, &start_offset);
1026 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary); 1030 ui::TextBoundaryType boundary = IA2TextBoundaryToTextBoundary(ia2_boundary);
1027 std::vector<int32> line_breaks; 1031 std::vector<int32> line_breaks;
1028 return ui::FindAccessibleTextBoundary( 1032 return ui::FindAccessibleTextBoundary(
1029 text, line_breaks, boundary, start_offset, direction); 1033 text, line_breaks, boundary, start_offset, direction);
1030 } 1034 }
OLDNEW
« no previous file with comments | « ui/ui.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698