| 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 20 matching lines...) Expand all Loading... |
| 31 #include "base/win/windows_version.h" | 31 #include "base/win/windows_version.h" |
| 32 #include "chrome/common/importer/ie_importer_utils_win.h" | 32 #include "chrome/common/importer/ie_importer_utils_win.h" |
| 33 #include "chrome/common/importer/imported_bookmark_entry.h" | 33 #include "chrome/common/importer/imported_bookmark_entry.h" |
| 34 #include "chrome/common/importer/imported_favicon_usage.h" | 34 #include "chrome/common/importer/imported_favicon_usage.h" |
| 35 #include "chrome/common/importer/importer_bridge.h" | 35 #include "chrome/common/importer/importer_bridge.h" |
| 36 #include "chrome/common/importer/importer_data_types.h" | 36 #include "chrome/common/importer/importer_data_types.h" |
| 37 #include "chrome/common/importer/importer_url_row.h" | 37 #include "chrome/common/importer/importer_url_row.h" |
| 38 #include "chrome/common/importer/pstore_declarations.h" | 38 #include "chrome/common/importer/pstore_declarations.h" |
| 39 #include "chrome/common/url_constants.h" | 39 #include "chrome/common/url_constants.h" |
| 40 #include "chrome/utility/importer/favicon_reencode.h" | 40 #include "chrome/utility/importer/favicon_reencode.h" |
| 41 #include "content/public/common/password_form.h" | 41 #include "components/autofill/core/common/password_form.h" |
| 42 #include "grit/generated_resources.h" | 42 #include "grit/generated_resources.h" |
| 43 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
| 44 #include "url/gurl.h" | 44 #include "url/gurl.h" |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 // Registry key paths from which we import IE settings. | 48 // Registry key paths from which we import IE settings. |
| 49 const char16 kSearchScopePath[] = | 49 const char16 kSearchScopePath[] = |
| 50 L"Software\\Microsoft\\Internet Explorer\\SearchScopes"; | 50 L"Software\\Microsoft\\Internet Explorer\\SearchScopes"; |
| 51 const char16 kIEVersionKey[] = | 51 const char16 kIEVersionKey[] = |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(), chrome::kHttpScheme) || |
| 607 LowerCaseEqualsASCII(url.scheme(), content::kHttpsScheme))) { | 607 LowerCaseEqualsASCII(url.scheme(), content::kHttpsScheme))) { |
| 608 continue; | 608 continue; |
| 609 } | 609 } |
| 610 | 610 |
| 611 content::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(); |
| 617 form.origin = url.ReplaceComponents(rp); | 617 form.origin = url.ReplaceComponents(rp); |
| 618 form.username_value = ac_list[i].data[0]; | 618 form.username_value = ac_list[i].data[0]; |
| 619 form.password_value = ac_list[i].data[1]; | 619 form.password_value = ac_list[i].data[1]; |
| 620 form.signon_realm = url.GetOrigin().spec(); | 620 form.signon_realm = url.GetOrigin().spec(); |
| 621 | 621 |
| (...skipping 251 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 |