OLD | NEW |
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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <atlctl.h> | 7 #include <atlctl.h> |
8 #include <initguid.h> | 8 #include <initguid.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (FAILED(hr)) | 55 if (FAILED(hr)) |
56 return hr; | 56 return hr; |
57 | 57 |
58 // We use the same class creation logic as ATL itself. See | 58 // We use the same class creation logic as ATL itself. See |
59 // _ATL_OBJMAP_ENTRY::RegisterClassObject() in atlbase.h | 59 // _ATL_OBJMAP_ENTRY::RegisterClassObject() in atlbase.h |
60 hr = ImplType::_ClassFactoryCreatorClass::CreateInstance( | 60 hr = ImplType::_ClassFactoryCreatorClass::CreateInstance( |
61 ImplType::_CreatorClass::CreateInstance, IID_IUnknown, | 61 ImplType::_CreatorClass::CreateInstance, IID_IUnknown, |
62 instance_.ReceiveVoid()); | 62 instance_.ReceiveVoid()); |
63 if (FAILED(hr)) | 63 if (FAILED(hr)) |
64 return hr; | 64 return hr; |
65 hr = ::CoRegisterClassObject(clsid, instance_, CLSCTX_LOCAL_SERVER, | 65 hr = ::CoRegisterClassObject(clsid, instance_.get(), CLSCTX_LOCAL_SERVER, |
66 REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED, ®istration_token_); | 66 REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED, |
| 67 ®istration_token_); |
67 if (FAILED(hr)) | 68 if (FAILED(hr)) |
68 return hr; | 69 return hr; |
69 | 70 |
70 return ParentClass::PreMessageLoop(nShowCmd); | 71 return ParentClass::PreMessageLoop(nShowCmd); |
71 } | 72 } |
72 | 73 |
73 HRESULT PostMessageLoop() { | 74 HRESULT PostMessageLoop() { |
74 if (registration_token_ != 0) { | 75 if (registration_token_ != 0) { |
75 ::CoRevokeClassObject(registration_token_); | 76 ::CoRevokeClassObject(registration_token_); |
76 registration_token_ = 0; | 77 registration_token_ = 0; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 case DelegateExecuteOperation::RELAUNCH_CHROME: | 193 case DelegateExecuteOperation::RELAUNCH_CHROME: |
193 ret_code = RelaunchChrome(operation); | 194 ret_code = RelaunchChrome(operation); |
194 break; | 195 break; |
195 default: | 196 default: |
196 NOTREACHED(); | 197 NOTREACHED(); |
197 } | 198 } |
198 } | 199 } |
199 AtlTrace("delegate_execute exit, code = %d\n", ret_code); | 200 AtlTrace("delegate_execute exit, code = %d\n", ret_code); |
200 return ret_code; | 201 return ret_code; |
201 } | 202 } |
OLD | NEW |