OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/importer/ie_importer.h" | 5 #include "chrome/browser/importer/ie_importer.h" |
6 | 6 |
7 #include <ole2.h> | 7 #include <ole2.h> |
8 #include <intshcut.h> | 8 #include <intshcut.h> |
9 #include <pstore.h> | 9 #include <pstore.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 pstore.Release(); | 204 pstore.Release(); |
205 FreeLibrary(pstorec_dll); | 205 FreeLibrary(pstorec_dll); |
206 | 206 |
207 size_t i; | 207 size_t i; |
208 for (i = 0; i < ac_list.size(); i++) { | 208 for (i = 0; i < ac_list.size(); i++) { |
209 if (!ac_list[i].is_url || ac_list[i].data.size() < 2) | 209 if (!ac_list[i].is_url || ac_list[i].data.size() < 2) |
210 continue; | 210 continue; |
211 | 211 |
212 GURL url(ac_list[i].key.c_str()); | 212 GURL url(ac_list[i].key.c_str()); |
213 if (!(LowerCaseEqualsASCII(url.scheme(), chrome::kHttpScheme) || | 213 if (!(LowerCaseEqualsASCII(url.scheme(), chrome::kHttpScheme) || |
214 LowerCaseEqualsASCII(url.scheme(), chrome::kHttpsScheme))) { | 214 LowerCaseEqualsASCII(url.scheme(), chrome::kHttpsScheme) || |
| 215 LowerCaseEqualsASCII(url.scheme(), chrome::kHttpsvScheme))) { |
215 continue; | 216 continue; |
216 } | 217 } |
217 | 218 |
218 PasswordForm form; | 219 PasswordForm form; |
219 GURL::Replacements rp; | 220 GURL::Replacements rp; |
220 rp.ClearUsername(); | 221 rp.ClearUsername(); |
221 rp.ClearPassword(); | 222 rp.ClearPassword(); |
222 rp.ClearQuery(); | 223 rp.ClearQuery(); |
223 rp.ClearRef(); | 224 rp.ClearRef(); |
224 form.origin = url.ReplaceComponents(rp); | 225 form.origin = url.ReplaceComponents(rp); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 283 } |
283 | 284 |
284 ++reg_iterator; | 285 ++reg_iterator; |
285 } | 286 } |
286 } | 287 } |
287 | 288 |
288 // Reads history information from COM interface. | 289 // Reads history information from COM interface. |
289 void IEImporter::ImportHistory() { | 290 void IEImporter::ImportHistory() { |
290 const std::string kSchemes[] = {chrome::kHttpScheme, | 291 const std::string kSchemes[] = {chrome::kHttpScheme, |
291 chrome::kHttpsScheme, | 292 chrome::kHttpsScheme, |
| 293 chrome::kHttpsvScheme, |
292 chrome::kFtpScheme, | 294 chrome::kFtpScheme, |
293 chrome::kFileScheme}; | 295 chrome::kFileScheme}; |
294 int total_schemes = arraysize(kSchemes); | 296 int total_schemes = arraysize(kSchemes); |
295 | 297 |
296 ScopedComPtr<IUrlHistoryStg2> url_history_stg2; | 298 ScopedComPtr<IUrlHistoryStg2> url_history_stg2; |
297 HRESULT result; | 299 HRESULT result; |
298 result = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, | 300 result = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, |
299 CLSCTX_INPROC_SERVER); | 301 CLSCTX_INPROC_SERVER); |
300 if (FAILED(result)) | 302 if (FAILED(result)) |
301 return; | 303 return; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 if (version < 0) { | 590 if (version < 0) { |
589 wchar_t buffer[128]; | 591 wchar_t buffer[128]; |
590 DWORD buffer_length = sizeof(buffer); | 592 DWORD buffer_length = sizeof(buffer); |
591 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, | 593 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, |
592 L"Software\\Microsoft\\Internet Explorer", KEY_READ); | 594 L"Software\\Microsoft\\Internet Explorer", KEY_READ); |
593 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 595 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
594 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); | 596 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); |
595 } | 597 } |
596 return version; | 598 return version; |
597 } | 599 } |
OLD | NEW |