| 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 "chrome/browser/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shobjidl.h> | 8 #include <shobjidl.h> |
| 9 #include <propkey.h> | 9 #include <propkey.h> |
| 10 #include <propvarutil.h> | 10 #include <propvarutil.h> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 ShellIntegration::DefaultWebClientState ProbeAppIsDefaultHandlers( | 92 ShellIntegration::DefaultWebClientState ProbeAppIsDefaultHandlers( |
| 93 const wchar_t* const* protocols, | 93 const wchar_t* const* protocols, |
| 94 size_t num_protocols) { | 94 size_t num_protocols) { |
| 95 base::win::ScopedComPtr<IApplicationAssociationRegistration> registration; | 95 base::win::ScopedComPtr<IApplicationAssociationRegistration> registration; |
| 96 HRESULT hr = registration.CreateInstance( | 96 HRESULT hr = registration.CreateInstance( |
| 97 CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC); | 97 CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC); |
| 98 if (FAILED(hr)) | 98 if (FAILED(hr)) |
| 99 return ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT; | 99 return ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT; |
| 100 | 100 |
| 101 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 101 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 102 string16 app_name(dist->GetApplicationName()); | 102 string16 app_name(dist->GetAppName()); |
| 103 app_name += ShellUtil::GetCurrentInstallationSuffix(); | |
| 104 | 103 |
| 105 BOOL result; | 104 BOOL result; |
| 106 for (size_t i = 0; i < num_protocols; ++i) { | 105 for (size_t i = 0; i < num_protocols; ++i) { |
| 107 result = TRUE; | 106 result = TRUE; |
| 108 hr = registration->QueryAppIsDefault(protocols[i], AT_URLPROTOCOL, | 107 hr = registration->QueryAppIsDefault(protocols[i], AT_URLPROTOCOL, |
| 109 AL_EFFECTIVE, app_name.c_str(), &result); | 108 AL_EFFECTIVE, app_name.c_str(), &result); |
| 110 if (FAILED(hr) || result == FALSE) | 109 if (FAILED(hr) || result == FALSE) |
| 111 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; | 110 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; |
| 112 } | 111 } |
| 113 | 112 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 } | 516 } |
| 518 | 517 |
| 519 void ShellIntegration::MigrateChromiumShortcuts() { | 518 void ShellIntegration::MigrateChromiumShortcuts() { |
| 520 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 519 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
| 521 return; | 520 return; |
| 522 | 521 |
| 523 BrowserThread::PostTask( | 522 BrowserThread::PostTask( |
| 524 BrowserThread::FILE, FROM_HERE, | 523 BrowserThread::FILE, FROM_HERE, |
| 525 base::Bind(&MigrateChromiumShortcutsCallback)); | 524 base::Bind(&MigrateChromiumShortcutsCallback)); |
| 526 } | 525 } |
| OLD | NEW |