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 28 matching lines...) Expand all Loading... |
39 public : | 39 public : |
40 typedef ATL::CAtlExeModuleT<DelegateExecuteModule> ParentClass; | 40 typedef ATL::CAtlExeModuleT<DelegateExecuteModule> ParentClass; |
41 typedef CComObject<CommandExecuteImpl> ImplType; | 41 typedef CComObject<CommandExecuteImpl> ImplType; |
42 | 42 |
43 DelegateExecuteModule() | 43 DelegateExecuteModule() |
44 : registration_token_(0) { | 44 : registration_token_(0) { |
45 } | 45 } |
46 | 46 |
47 HRESULT PreMessageLoop(int nShowCmd) { | 47 HRESULT PreMessageLoop(int nShowCmd) { |
48 HRESULT hr = S_OK; | 48 HRESULT hr = S_OK; |
49 base::string16 clsid_string; | |
50 GUID clsid; | 49 GUID clsid; |
51 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 50 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
52 if (!dist->GetCommandExecuteImplClsid(&clsid_string)) | 51 const base::string16 clsid_string = dist->GetCommandExecuteImplClsid(); |
| 52 if (clsid_string.empty()) |
53 return E_FAIL; | 53 return E_FAIL; |
54 hr = ::CLSIDFromString(clsid_string.c_str(), &clsid); | 54 hr = ::CLSIDFromString(clsid_string.c_str(), &clsid); |
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()); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 case DelegateExecuteOperation::RELAUNCH_CHROME: | 193 case DelegateExecuteOperation::RELAUNCH_CHROME: |
194 ret_code = RelaunchChrome(operation); | 194 ret_code = RelaunchChrome(operation); |
195 break; | 195 break; |
196 default: | 196 default: |
197 NOTREACHED(); | 197 NOTREACHED(); |
198 } | 198 } |
199 } | 199 } |
200 AtlTrace("delegate_execute exit, code = %d\n", ret_code); | 200 AtlTrace("delegate_execute exit, code = %d\n", ret_code); |
201 return ret_code; | 201 return ret_code; |
202 } | 202 } |
OLD | NEW |