| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC); | 105 CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC); |
| 106 if (FAILED(hr)) | 106 if (FAILED(hr)) |
| 107 return ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT; | 107 return ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT; |
| 108 | 108 |
| 109 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 109 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 110 FilePath chrome_exe; | 110 FilePath chrome_exe; |
| 111 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { | 111 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
| 112 NOTREACHED(); | 112 NOTREACHED(); |
| 113 return ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT; | 113 return ShellIntegration::UNKNOWN_DEFAULT_WEB_CLIENT; |
| 114 } | 114 } |
| 115 string16 app_name(dist->GetApplicationName()); | 115 string16 app_name(ShellUtil::GetApplicationName(dist, chrome_exe.value())); |
| 116 app_name += ShellUtil::GetCurrentInstallationSuffix(dist, chrome_exe.value()); | |
| 117 | 116 |
| 118 BOOL result; | 117 BOOL result; |
| 119 for (size_t i = 0; i < num_protocols; ++i) { | 118 for (size_t i = 0; i < num_protocols; ++i) { |
| 120 result = TRUE; | 119 result = TRUE; |
| 121 hr = registration->QueryAppIsDefault(protocols[i], AT_URLPROTOCOL, | 120 hr = registration->QueryAppIsDefault(protocols[i], AT_URLPROTOCOL, |
| 122 AL_EFFECTIVE, app_name.c_str(), &result); | 121 AL_EFFECTIVE, app_name.c_str(), &result); |
| 123 if (FAILED(hr) || result == FALSE) | 122 if (FAILED(hr) || result == FALSE) |
| 124 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; | 123 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; |
| 125 } | 124 } |
| 126 | 125 |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 BrowserThread::PostTask( | 593 BrowserThread::PostTask( |
| 595 BrowserThread::FILE, FROM_HERE, | 594 BrowserThread::FILE, FROM_HERE, |
| 596 base::Bind(&MigrateChromiumShortcutsCallback)); | 595 base::Bind(&MigrateChromiumShortcutsCallback)); |
| 597 } | 596 } |
| 598 | 597 |
| 599 bool ShellIntegration::ActivateMetroChrome() { | 598 bool ShellIntegration::ActivateMetroChrome() { |
| 600 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 599 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 601 const string16 app_id(dist->GetBrowserAppId()); | 600 const string16 app_id(dist->GetBrowserAppId()); |
| 602 return ActivateApplication(app_id); | 601 return ActivateApplication(app_id); |
| 603 } | 602 } |
| OLD | NEW |