| OLD | NEW |
| 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 "views/accessibility/view_accessibility.h" | 7 #include "views/accessibility/view_accessibility.h" |
| 8 | 8 |
| 9 //////////////////////////////////////////////////////////////////////////////// | 9 //////////////////////////////////////////////////////////////////////////////// |
| 10 // | 10 // |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // If there is no instance of ViewAccessibility created, create it | 22 // If there is no instance of ViewAccessibility created, create it |
| 23 // now. Otherwise reuse previous instance. | 23 // now. Otherwise reuse previous instance. |
| 24 if (!accessibility_info_) { | 24 if (!accessibility_info_) { |
| 25 CComObject<ViewAccessibility>* instance = NULL; | 25 CComObject<ViewAccessibility>* instance = NULL; |
| 26 | 26 |
| 27 HRESULT hr = CComObject<ViewAccessibility>::CreateInstance(&instance); | 27 HRESULT hr = CComObject<ViewAccessibility>::CreateInstance(&instance); |
| 28 | 28 |
| 29 if (!SUCCEEDED(hr) || !instance) | 29 if (!SUCCEEDED(hr) || !instance) |
| 30 return E_FAIL; | 30 return E_FAIL; |
| 31 | 31 |
| 32 CComPtr<IAccessible> accessibility_instance(instance); | 32 ScopedComPtr<IAccessible> accessibility_instance(instance); |
| 33 | 33 |
| 34 if (!SUCCEEDED(instance->Initialize(view_))) | 34 if (!SUCCEEDED(instance->Initialize(view_))) |
| 35 return E_FAIL; | 35 return E_FAIL; |
| 36 | 36 |
| 37 // All is well, assign the temp instance to the class smart pointer. | 37 // All is well, assign the temp instance to the class smart pointer. |
| 38 accessibility_info_.Attach(accessibility_instance.Detach()); | 38 accessibility_info_.Attach(accessibility_instance.Detach()); |
| 39 } | 39 } |
| 40 return S_OK; | 40 return S_OK; |
| 41 } | 41 } |
| 42 // Interface not supported. | 42 // Interface not supported. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 70 return E_NOINTERFACE; | 70 return E_NOINTERFACE; |
| 71 | 71 |
| 72 accessibility_info_.Attach(interface_ptr); | 72 accessibility_info_.Attach(interface_ptr); |
| 73 | 73 |
| 74 // Paranoia check, to make sure we do have a valid IAccessible pointer stored. | 74 // Paranoia check, to make sure we do have a valid IAccessible pointer stored. |
| 75 if (!accessibility_info_) | 75 if (!accessibility_info_) |
| 76 return E_FAIL; | 76 return E_FAIL; |
| 77 | 77 |
| 78 return S_OK; | 78 return S_OK; |
| 79 } | 79 } |
| OLD | NEW |