Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: chrome/utility/importer/ie_importer_win.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/utility/importer/bookmark_html_reader.cc ('k') | chrome/utility/importer/nss_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698