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