| 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 // This file defines functions that integrate Chrome in Windows shell. These | 5 // This file defines functions that integrate Chrome in Windows shell. These |
| 6 // functions can be used by Chrome as well as Chrome installer. All of the | 6 // functions can be used by Chrome as well as Chrome installer. All of the |
| 7 // work is done by the local functions defined in anonymous namespace in | 7 // work is done by the local functions defined in anonymous namespace in |
| 8 // this class. | 8 // this class. |
| 9 | 9 |
| 10 #include "chrome/installer/util/shell_util.h" | 10 #include "chrome/installer/util/shell_util.h" |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 bool LaunchDefaultAppsSettingsModernDialog(const wchar_t* protocol) { | 753 bool LaunchDefaultAppsSettingsModernDialog(const wchar_t* protocol) { |
| 754 DCHECK(protocol); | 754 DCHECK(protocol); |
| 755 static const wchar_t kControlPanelAppModelId[] = | 755 static const wchar_t kControlPanelAppModelId[] = |
| 756 L"windows.immersivecontrolpanel_cw5n1h2txyewy" | 756 L"windows.immersivecontrolpanel_cw5n1h2txyewy" |
| 757 L"!microsoft.windows.immersivecontrolpanel"; | 757 L"!microsoft.windows.immersivecontrolpanel"; |
| 758 | 758 |
| 759 base::win::ScopedComPtr<IApplicationActivationManager> activator; | 759 base::win::ScopedComPtr<IApplicationActivationManager> activator; |
| 760 HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager); | 760 HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager); |
| 761 if (SUCCEEDED(hr)) { | 761 if (SUCCEEDED(hr)) { |
| 762 DWORD pid = 0; | 762 DWORD pid = 0; |
| 763 CoAllowSetForegroundWindow(activator.get(), nullptr); | 763 CoAllowSetForegroundWindow(activator.Get(), nullptr); |
| 764 hr = activator->ActivateApplication(kControlPanelAppModelId, | 764 hr = activator->ActivateApplication(kControlPanelAppModelId, |
| 765 L"page=SettingsPageAppsDefaults", | 765 L"page=SettingsPageAppsDefaults", |
| 766 AO_NONE, &pid); | 766 AO_NONE, &pid); |
| 767 if (SUCCEEDED(hr)) { | 767 if (SUCCEEDED(hr)) { |
| 768 hr = activator->ActivateApplication( | 768 hr = activator->ActivateApplication( |
| 769 kControlPanelAppModelId, | 769 kControlPanelAppModelId, |
| 770 base::StringPrintf(L"page=SettingsPageAppsDefaults&target=%ls", | 770 base::StringPrintf(L"page=SettingsPageAppsDefaults&target=%ls", |
| 771 GetTargetForDefaultAppsSettings(protocol).c_str()) | 771 GetTargetForDefaultAppsSettings(protocol).c_str()) |
| 772 .c_str(), | 772 .c_str(), |
| 773 AO_NONE, &pid); | 773 AO_NONE, &pid); |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2343 for (const auto& entry : entries) | 2343 for (const auto& entry : entries) |
| 2344 entry->AddToWorkItemList(root, items.get()); | 2344 entry->AddToWorkItemList(root, items.get()); |
| 2345 | 2345 |
| 2346 // Apply all the registry changes and if there is a problem, rollback | 2346 // Apply all the registry changes and if there is a problem, rollback |
| 2347 if (!items->Do()) { | 2347 if (!items->Do()) { |
| 2348 items->Rollback(); | 2348 items->Rollback(); |
| 2349 return false; | 2349 return false; |
| 2350 } | 2350 } |
| 2351 return true; | 2351 return true; |
| 2352 } | 2352 } |
| OLD | NEW |