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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 data.insert(0, reinterpret_cast<wchar_t*>(buffer), | 589 data.insert(0, reinterpret_cast<wchar_t*>(buffer), |
590 length / sizeof(wchar_t)); | 590 length / sizeof(wchar_t)); |
591 | 591 |
592 // The key name is always ended with ":StringData". | 592 // The key name is always ended with ":StringData". |
593 const wchar_t kDataSuffix[] = L":StringData"; | 593 const wchar_t kDataSuffix[] = L":StringData"; |
594 size_t i = ac.key.rfind(kDataSuffix); | 594 size_t i = ac.key.rfind(kDataSuffix); |
595 if (i != base::string16::npos && ac.key.substr(i) == kDataSuffix) { | 595 if (i != base::string16::npos && ac.key.substr(i) == kDataSuffix) { |
596 ac.key.erase(i); | 596 ac.key.erase(i); |
597 ac.is_url = (ac.key.find(L"://") != base::string16::npos); | 597 ac.is_url = (ac.key.find(L"://") != base::string16::npos); |
598 ac_list.push_back(ac); | 598 ac_list.push_back(ac); |
599 base::SplitString(data, L'\0', &ac_list[ac_list.size() - 1].data); | 599 ac_list[ac_list.size() - 1].data = base::SplitString( |
| 600 data, base::string16(1, '\0'), |
| 601 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
600 } | 602 } |
601 CoTaskMemFree(buffer); | 603 CoTaskMemFree(buffer); |
602 } | 604 } |
603 CoTaskMemFree(item_name); | 605 CoTaskMemFree(item_name); |
604 } | 606 } |
605 // Releases them before unload the dll. | 607 // Releases them before unload the dll. |
606 item.Release(); | 608 item.Release(); |
607 pstore.Release(); | 609 pstore.Release(); |
608 FreeLibrary(pstorec_dll); | 610 FreeLibrary(pstorec_dll); |
609 | 611 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 static int version = -1; | 885 static int version = -1; |
884 if (version < 0) { | 886 if (version < 0) { |
885 wchar_t buffer[128]; | 887 wchar_t buffer[128]; |
886 DWORD buffer_length = sizeof(buffer); | 888 DWORD buffer_length = sizeof(buffer); |
887 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); | 889 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); |
888 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); | 890 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); |
889 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); | 891 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); |
890 } | 892 } |
891 return version; | 893 return version; |
892 } | 894 } |
OLD | NEW |