| 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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 // A helper function that probes default protocol handler registration (in a | 1142 // A helper function that probes default protocol handler registration (in a |
| 1143 // manner appropriate for the current version of Windows) to determine if | 1143 // manner appropriate for the current version of Windows) to determine if |
| 1144 // Chrome is the default handler for |protocols|. Returns IS_DEFAULT | 1144 // Chrome is the default handler for |protocols|. Returns IS_DEFAULT |
| 1145 // only if Chrome is the default for all specified protocols. | 1145 // only if Chrome is the default for all specified protocols. |
| 1146 ShellUtil::DefaultState ProbeProtocolHandlers( | 1146 ShellUtil::DefaultState ProbeProtocolHandlers( |
| 1147 const base::FilePath& chrome_exe, | 1147 const base::FilePath& chrome_exe, |
| 1148 const wchar_t* const* protocols, | 1148 const wchar_t* const* protocols, |
| 1149 size_t num_protocols) { | 1149 size_t num_protocols) { |
| 1150 #if DCHECK_IS_ON |
| 1150 DCHECK(!num_protocols || protocols); | 1151 DCHECK(!num_protocols || protocols); |
| 1151 if (DCHECK_IS_ON()) { | 1152 for (size_t i = 0; i < num_protocols; ++i) |
| 1152 for (size_t i = 0; i < num_protocols; ++i) | 1153 DCHECK(protocols[i] && *protocols[i]); |
| 1153 DCHECK(protocols[i] && *protocols[i]); | 1154 #endif |
| 1154 } | |
| 1155 | 1155 |
| 1156 const base::win::Version windows_version = base::win::GetVersion(); | 1156 const base::win::Version windows_version = base::win::GetVersion(); |
| 1157 | 1157 |
| 1158 if (windows_version >= base::win::VERSION_WIN8) | 1158 if (windows_version >= base::win::VERSION_WIN8) |
| 1159 return ProbeCurrentDefaultHandlers(chrome_exe, protocols, num_protocols); | 1159 return ProbeCurrentDefaultHandlers(chrome_exe, protocols, num_protocols); |
| 1160 else if (windows_version >= base::win::VERSION_VISTA) | 1160 else if (windows_version >= base::win::VERSION_VISTA) |
| 1161 return ProbeAppIsDefaultHandlers(chrome_exe, protocols, num_protocols); | 1161 return ProbeAppIsDefaultHandlers(chrome_exe, protocols, num_protocols); |
| 1162 | 1162 |
| 1163 return ProbeOpenCommandHandlers(chrome_exe, protocols, num_protocols); | 1163 return ProbeOpenCommandHandlers(chrome_exe, protocols, num_protocols); |
| 1164 } | 1164 } |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2264 // are any left...). | 2264 // are any left...). |
| 2265 if (free_bits >= 8 && next_byte_index < size) { | 2265 if (free_bits >= 8 && next_byte_index < size) { |
| 2266 free_bits -= 8; | 2266 free_bits -= 8; |
| 2267 bit_stream += bytes[next_byte_index++] << free_bits; | 2267 bit_stream += bytes[next_byte_index++] << free_bits; |
| 2268 } | 2268 } |
| 2269 } | 2269 } |
| 2270 | 2270 |
| 2271 DCHECK_EQ(ret.length(), encoded_length); | 2271 DCHECK_EQ(ret.length(), encoded_length); |
| 2272 return ret; | 2272 return ret; |
| 2273 } | 2273 } |
| OLD | NEW |