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 LOG(DFATAL) << "PathService::Get failed."; | 112 LOG(DFATAL) << "PathService::Get failed."; |
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 BrowserThread::PostTask( | 569 BrowserThread::PostTask( |
571 BrowserThread::FILE, FROM_HERE, | 570 BrowserThread::FILE, FROM_HERE, |
572 base::Bind(&MigrateChromiumShortcutsCallback)); | 571 base::Bind(&MigrateChromiumShortcutsCallback)); |
573 } | 572 } |
574 | 573 |
575 bool ShellIntegration::ActivateMetroChrome() { | 574 bool ShellIntegration::ActivateMetroChrome() { |
576 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 575 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
577 const string16 app_id(dist->GetBrowserAppId()); | 576 const string16 app_id(dist->GetBrowserAppId()); |
578 return ActivateApplication(app_id); | 577 return ActivateApplication(app_id); |
579 } | 578 } |
OLD | NEW |