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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 } | 1275 } |
1276 | 1276 |
1277 // A helper function that probes default protocol handler registration (in a | 1277 // A helper function that probes default protocol handler registration (in a |
1278 // manner appropriate for the current version of Windows) to determine if | 1278 // manner appropriate for the current version of Windows) to determine if |
1279 // Chrome is the default handler for |protocols|. Returns IS_DEFAULT | 1279 // Chrome is the default handler for |protocols|. Returns IS_DEFAULT |
1280 // only if Chrome is the default for all specified protocols. | 1280 // only if Chrome is the default for all specified protocols. |
1281 ShellUtil::DefaultState ProbeProtocolHandlers( | 1281 ShellUtil::DefaultState ProbeProtocolHandlers( |
1282 const base::FilePath& chrome_exe, | 1282 const base::FilePath& chrome_exe, |
1283 const wchar_t* const* protocols, | 1283 const wchar_t* const* protocols, |
1284 size_t num_protocols) { | 1284 size_t num_protocols) { |
1285 #if DCHECK_IS_ON | 1285 #if DCHECK_IS_ON() |
1286 DCHECK(!num_protocols || protocols); | 1286 DCHECK(!num_protocols || protocols); |
1287 for (size_t i = 0; i < num_protocols; ++i) | 1287 for (size_t i = 0; i < num_protocols; ++i) |
1288 DCHECK(protocols[i] && *protocols[i]); | 1288 DCHECK(protocols[i] && *protocols[i]); |
1289 #endif | 1289 #endif |
1290 | 1290 |
1291 const base::win::Version windows_version = base::win::GetVersion(); | 1291 const base::win::Version windows_version = base::win::GetVersion(); |
1292 | 1292 |
1293 if (windows_version >= base::win::VERSION_WIN8) | 1293 if (windows_version >= base::win::VERSION_WIN8) |
1294 return ProbeCurrentDefaultHandlers(chrome_exe, protocols, num_protocols); | 1294 return ProbeCurrentDefaultHandlers(chrome_exe, protocols, num_protocols); |
1295 else if (windows_version >= base::win::VERSION_VISTA) | 1295 else if (windows_version >= base::win::VERSION_VISTA) |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2470 base::string16 key_path(ShellUtil::kRegClasses); | 2470 base::string16 key_path(ShellUtil::kRegClasses); |
2471 key_path.push_back(base::FilePath::kSeparators[0]); | 2471 key_path.push_back(base::FilePath::kSeparators[0]); |
2472 key_path.append(prog_id); | 2472 key_path.append(prog_id); |
2473 return InstallUtil::DeleteRegistryKey( | 2473 return InstallUtil::DeleteRegistryKey( |
2474 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); | 2474 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); |
2475 | 2475 |
2476 // TODO(mgiuca): Remove the extension association entries. This requires that | 2476 // TODO(mgiuca): Remove the extension association entries. This requires that |
2477 // the extensions associated with a particular prog_id are stored in that | 2477 // the extensions associated with a particular prog_id are stored in that |
2478 // prog_id's key. | 2478 // prog_id's key. |
2479 } | 2479 } |
OLD | NEW |