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