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 <stddef.h> | 10 #include <stddef.h> |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 GURL::Replacements rp; | 655 GURL::Replacements rp; |
656 rp.ClearUsername(); | 656 rp.ClearUsername(); |
657 rp.ClearPassword(); | 657 rp.ClearPassword(); |
658 rp.ClearQuery(); | 658 rp.ClearQuery(); |
659 rp.ClearRef(); | 659 rp.ClearRef(); |
660 form.origin = url.ReplaceComponents(rp); | 660 form.origin = url.ReplaceComponents(rp); |
661 form.username_value = ac_list[i].data[0]; | 661 form.username_value = ac_list[i].data[0]; |
662 form.password_value = ac_list[i].data[1]; | 662 form.password_value = ac_list[i].data[1]; |
663 form.signon_realm = url.GetOrigin().spec(); | 663 form.signon_realm = url.GetOrigin().spec(); |
664 | 664 |
665 // This is not precise, because a scheme of https does not imply a valid | |
666 // certificate was presented; however we assign it this way so that if we | |
667 // import a password from IE whose scheme is https, we give it the benefit | |
668 // of the doubt and DON'T auto-fill it unless the form appears under | |
669 // valid TLS conditions. | |
670 form.ssl_valid = url.SchemeIsCryptographic(); | |
671 | |
672 // Goes through the list to find out the username field | 665 // Goes through the list to find out the username field |
673 // of the web page. | 666 // of the web page. |
674 size_t list_it, item_it; | 667 size_t list_it, item_it; |
675 for (list_it = 0; list_it < ac_list.size(); ++list_it) { | 668 for (list_it = 0; list_it < ac_list.size(); ++list_it) { |
676 if (ac_list[list_it].is_url) | 669 if (ac_list[list_it].is_url) |
677 continue; | 670 continue; |
678 | 671 |
679 for (item_it = 0; item_it < ac_list[list_it].data.size(); ++item_it) | 672 for (item_it = 0; item_it < ac_list[list_it].data.size(); ++item_it) |
680 if (ac_list[list_it].data[item_it] == form.username_value) { | 673 if (ac_list[list_it].data[item_it] == form.username_value) { |
681 form.username_element = ac_list[list_it].key; | 674 form.username_element = ac_list[list_it].key; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 static int version = -1; | 911 static int version = -1; |
919 if (version < 0) { | 912 if (version < 0) { |
920 wchar_t buffer[128]; | 913 wchar_t buffer[128]; |
921 DWORD buffer_length = sizeof(buffer); | 914 DWORD buffer_length = sizeof(buffer); |
922 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); | 915 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); |
923 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 916 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
924 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); | 917 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); |
925 } | 918 } |
926 return version; | 919 return version; |
927 } | 920 } |
OLD | NEW |