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/utility/importer/ie_importer_win.h" | 5 #include "chrome/utility/importer/ie_importer_win.h" |
6 | 6 |
7 #include <ole2.h> | 7 #include <ole2.h> |
8 #include <intshcut.h> | 8 #include <intshcut.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #include <urlhist.h> | 10 #include <urlhist.h> |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 if (!bookmarks.empty() && !cancelled()) { | 462 if (!bookmarks.empty() && !cancelled()) { |
463 const string16& first_folder_name = | 463 const string16& first_folder_name = |
464 l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_IE); | 464 l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_IE); |
465 bridge_->AddBookmarks(bookmarks, first_folder_name); | 465 bridge_->AddBookmarks(bookmarks, first_folder_name); |
466 } | 466 } |
467 if (!favicons.empty() && !cancelled()) | 467 if (!favicons.empty() && !cancelled()) |
468 bridge_->SetFavicons(favicons); | 468 bridge_->SetFavicons(favicons); |
469 } | 469 } |
470 | 470 |
471 void IEImporter::ImportHistory() { | 471 void IEImporter::ImportHistory() { |
472 const std::string kSchemes[] = {chrome::kHttpScheme, | 472 const std::string kSchemes[] = {content::kHttpScheme, |
473 content::kHttpsScheme, | 473 content::kHttpsScheme, |
474 chrome::kFtpScheme, | 474 chrome::kFtpScheme, |
475 chrome::kFileScheme}; | 475 chrome::kFileScheme}; |
476 int total_schemes = arraysize(kSchemes); | 476 int total_schemes = arraysize(kSchemes); |
477 | 477 |
478 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2; | 478 base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2; |
479 HRESULT result; | 479 HRESULT result; |
480 result = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, | 480 result = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL, |
481 CLSCTX_INPROC_SERVER); | 481 CLSCTX_INPROC_SERVER); |
482 if (FAILED(result)) | 482 if (FAILED(result)) |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 item.Release(); | 596 item.Release(); |
597 pstore.Release(); | 597 pstore.Release(); |
598 FreeLibrary(pstorec_dll); | 598 FreeLibrary(pstorec_dll); |
599 | 599 |
600 size_t i; | 600 size_t i; |
601 for (i = 0; i < ac_list.size(); i++) { | 601 for (i = 0; i < ac_list.size(); i++) { |
602 if (!ac_list[i].is_url || ac_list[i].data.size() < 2) | 602 if (!ac_list[i].is_url || ac_list[i].data.size() < 2) |
603 continue; | 603 continue; |
604 | 604 |
605 GURL url(ac_list[i].key.c_str()); | 605 GURL url(ac_list[i].key.c_str()); |
606 if (!(LowerCaseEqualsASCII(url.scheme(), chrome::kHttpScheme) || | 606 if (!(LowerCaseEqualsASCII(url.scheme(), content::kHttpScheme) || |
607 LowerCaseEqualsASCII(url.scheme(), content::kHttpsScheme))) { | 607 LowerCaseEqualsASCII(url.scheme(), content::kHttpsScheme))) { |
608 continue; | 608 continue; |
609 } | 609 } |
610 | 610 |
611 autofill::PasswordForm form; | 611 autofill::PasswordForm form; |
612 GURL::Replacements rp; | 612 GURL::Replacements rp; |
613 rp.ClearUsername(); | 613 rp.ClearUsername(); |
614 rp.ClearPassword(); | 614 rp.ClearPassword(); |
615 rp.ClearQuery(); | 615 rp.ClearQuery(); |
616 rp.ClearRef(); | 616 rp.ClearRef(); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 static int version = -1; | 873 static int version = -1; |
874 if (version < 0) { | 874 if (version < 0) { |
875 wchar_t buffer[128]; | 875 wchar_t buffer[128]; |
876 DWORD buffer_length = sizeof(buffer); | 876 DWORD buffer_length = sizeof(buffer); |
877 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); | 877 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); |
878 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 878 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
879 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); | 879 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); |
880 } | 880 } |
881 return version; | 881 return version; |
882 } | 882 } |
OLD | NEW |