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

Side by Side Diff: views/accessibility/view_accessibility_wrapper.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 | « views/accessibility/view_accessibility_wrapper.h ('k') | views/view.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "views/accessibility/view_accessibility_wrapper.h" 5 #include "views/accessibility/view_accessibility_wrapper.h"
6 6
7 #include "base/scoped_variant_win.h"
8
7 #include "views/accessibility/view_accessibility.h" 9 #include "views/accessibility/view_accessibility.h"
8 10
9 //////////////////////////////////////////////////////////////////////////////// 11 ////////////////////////////////////////////////////////////////////////////////
10 // 12 //
11 // ViewAccessibilityWrapper - constructors, destructors 13 // ViewAccessibilityWrapper - constructors, destructors
12 // 14 //
13 //////////////////////////////////////////////////////////////////////////////// 15 ////////////////////////////////////////////////////////////////////////////////
14 16
15 ViewAccessibilityWrapper::ViewAccessibilityWrapper(views::View* view) 17 ViewAccessibilityWrapper::ViewAccessibilityWrapper(views::View* view)
16 : accessibility_info_(NULL), 18 : accessibility_info_(NULL),
(...skipping 19 matching lines...) Expand all
36 38
37 // All is well, assign the temp instance to the class smart pointer. 39 // All is well, assign the temp instance to the class smart pointer.
38 accessibility_info_.Attach(accessibility_instance.Detach()); 40 accessibility_info_.Attach(accessibility_instance.Detach());
39 } 41 }
40 return S_OK; 42 return S_OK;
41 } 43 }
42 // Interface not supported. 44 // Interface not supported.
43 return E_NOINTERFACE; 45 return E_NOINTERFACE;
44 } 46 }
45 47
48 HRESULT ViewAccessibilityWrapper::Uninitialize() {
49 view_ = NULL;
50 if (accessibility_info_.get()) {
51 accessibility_info_->put_accValue(
52 ScopedVariant(kViewsUninitializeAccessibilityInstance), NULL);
53 ::CoDisconnectObject(accessibility_info_.get(), 0);
54 accessibility_info_ = NULL;
55 }
56
57 return S_OK;
58 }
59
46 STDMETHODIMP ViewAccessibilityWrapper::GetInstance(REFIID iid, 60 STDMETHODIMP ViewAccessibilityWrapper::GetInstance(REFIID iid,
47 void** interface_ptr) { 61 void** interface_ptr) {
48 if (IID_IUnknown == iid || IID_IDispatch == iid || IID_IAccessible == iid) { 62 if (IID_IUnknown == iid || IID_IDispatch == iid || IID_IAccessible == iid) {
49 // If there is no accessibility instance created, create a default now. 63 // If there is no accessibility instance created, create a default now.
50 // Otherwise reuse previous instance. 64 // Otherwise reuse previous instance.
51 if (!accessibility_info_) { 65 if (!accessibility_info_) {
52 HRESULT hr = CreateDefaultInstance(iid); 66 HRESULT hr = CreateDefaultInstance(iid);
53 67
54 if (hr != S_OK) { 68 if (hr != S_OK) {
55 // Interface creation failed. 69 // Interface creation failed.
(...skipping 14 matching lines...) Expand all
70 return E_NOINTERFACE; 84 return E_NOINTERFACE;
71 85
72 accessibility_info_.Attach(interface_ptr); 86 accessibility_info_.Attach(interface_ptr);
73 87
74 // Paranoia check, to make sure we do have a valid IAccessible pointer stored. 88 // Paranoia check, to make sure we do have a valid IAccessible pointer stored.
75 if (!accessibility_info_) 89 if (!accessibility_info_)
76 return E_FAIL; 90 return E_FAIL;
77 91
78 return S_OK; 92 return S_OK;
79 } 93 }
OLDNEW
« no previous file with comments | « views/accessibility/view_accessibility_wrapper.h ('k') | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698