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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 rp.ClearQuery(); | 625 rp.ClearQuery(); |
626 rp.ClearRef(); | 626 rp.ClearRef(); |
627 form.origin = url.ReplaceComponents(rp); | 627 form.origin = url.ReplaceComponents(rp); |
628 form.username_value = ac_list[i].data[0]; | 628 form.username_value = ac_list[i].data[0]; |
629 form.password_value = ac_list[i].data[1]; | 629 form.password_value = ac_list[i].data[1]; |
630 form.signon_realm = url.GetOrigin().spec(); | 630 form.signon_realm = url.GetOrigin().spec(); |
631 | 631 |
632 // This is not precise, because a scheme of https does not imply a valid | 632 // This is not precise, because a scheme of https does not imply a valid |
633 // certificate was presented; however we assign it this way so that if we | 633 // certificate was presented; however we assign it this way so that if we |
634 // import a password from IE whose scheme is https, we give it the benefit | 634 // import a password from IE whose scheme is https, we give it the benefit |
635 // of the doubt and DONT auto-fill it unless the form appears under | 635 // of the doubt and DON'T auto-fill it unless the form appears under |
636 // valid SSL conditions. | 636 // valid TLS conditions. |
637 form.ssl_valid = url.SchemeIsSecure(); | 637 form.ssl_valid = url.SchemeUsesTLS(); |
638 | 638 |
639 // Goes through the list to find out the username field | 639 // Goes through the list to find out the username field |
640 // of the web page. | 640 // of the web page. |
641 size_t list_it, item_it; | 641 size_t list_it, item_it; |
642 for (list_it = 0; list_it < ac_list.size(); ++list_it) { | 642 for (list_it = 0; list_it < ac_list.size(); ++list_it) { |
643 if (ac_list[list_it].is_url) | 643 if (ac_list[list_it].is_url) |
644 continue; | 644 continue; |
645 | 645 |
646 for (item_it = 0; item_it < ac_list[list_it].data.size(); ++item_it) | 646 for (item_it = 0; item_it < ac_list[list_it].data.size(); ++item_it) |
647 if (ac_list[list_it].data[item_it] == form.username_value) { | 647 if (ac_list[list_it].data[item_it] == form.username_value) { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 static int version = -1; | 883 static int version = -1; |
884 if (version < 0) { | 884 if (version < 0) { |
885 wchar_t buffer[128]; | 885 wchar_t buffer[128]; |
886 DWORD buffer_length = sizeof(buffer); | 886 DWORD buffer_length = sizeof(buffer); |
887 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); | 887 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); |
888 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 888 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
889 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); | 889 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); |
890 } | 890 } |
891 return version; | 891 return version; |
892 } | 892 } |
OLD | NEW |