OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser/importer/ie_importer.h" | 5 #include "chrome/browser/importer/ie_importer.h" |
6 | 6 |
7 #include <ole2.h> | 7 #include <ole2.h> |
8 #include <intshcut.h> | 8 #include <intshcut.h> |
9 #include <pstore.h> | 9 #include <pstore.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 info->path = buffer; | 455 info->path = buffer; |
456 | 456 |
457 // There is a Links folder under Favorites folder in Windows Vista, but it | 457 // There is a Links folder under Favorites folder in Windows Vista, but it |
458 // is not recording in Vista's registry. So in Vista, we assume the Links | 458 // is not recording in Vista's registry. So in Vista, we assume the Links |
459 // folder is under Favorites folder since it looks like there is not name | 459 // folder is under Favorites folder since it looks like there is not name |
460 // different in every language version of Windows Vista. | 460 // different in every language version of Windows Vista. |
461 if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { | 461 if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { |
462 // The Link folder name is stored in the registry. | 462 // The Link folder name is stored in the registry. |
463 DWORD buffer_length = sizeof(buffer); | 463 DWORD buffer_length = sizeof(buffer); |
464 RegKey reg_key(HKEY_CURRENT_USER, | 464 RegKey reg_key(HKEY_CURRENT_USER, |
465 L"Software\\Microsoft\\Internet Explorer\\Toolbar"); | 465 L"Software\\Microsoft\\Internet Explorer\\Toolbar", |
| 466 KEY_READ); |
466 if (!reg_key.ReadValue(L"LinksFolderName", buffer, &buffer_length, NULL)) | 467 if (!reg_key.ReadValue(L"LinksFolderName", buffer, &buffer_length, NULL)) |
467 return false; | 468 return false; |
468 info->links_folder = buffer; | 469 info->links_folder = buffer; |
469 } else { | 470 } else { |
470 info->links_folder = L"Links"; | 471 info->links_folder = L"Links"; |
471 } | 472 } |
472 | 473 |
473 return true; | 474 return true; |
474 } | 475 } |
475 | 476 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 565 |
565 return std::wstring(url); | 566 return std::wstring(url); |
566 } | 567 } |
567 | 568 |
568 int IEImporter::CurrentIEVersion() const { | 569 int IEImporter::CurrentIEVersion() const { |
569 static int version = -1; | 570 static int version = -1; |
570 if (version < 0) { | 571 if (version < 0) { |
571 wchar_t buffer[128]; | 572 wchar_t buffer[128]; |
572 DWORD buffer_length = sizeof(buffer); | 573 DWORD buffer_length = sizeof(buffer); |
573 RegKey reg_key(HKEY_LOCAL_MACHINE, | 574 RegKey reg_key(HKEY_LOCAL_MACHINE, |
574 L"Software\\Microsoft\\Internet Explorer"); | 575 L"Software\\Microsoft\\Internet Explorer", KEY_READ); |
575 bool result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 576 bool result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
576 version = (result ? _wtoi(buffer) : 0); | 577 version = (result ? _wtoi(buffer) : 0); |
577 } | 578 } |
578 return version; | 579 return version; |
579 } | 580 } |
OLD | NEW |