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

Unified Diff: chrome/utility/importer/ie_importer_win.cc

Issue 94013004: Add base:: to string16s in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try again Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/importer/ie_importer_win.h ('k') | chrome/utility/importer/nss_decryptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/importer/ie_importer_win.cc
diff --git a/chrome/utility/importer/ie_importer_win.cc b/chrome/utility/importer/ie_importer_win.cc
index b8b7f9b613c2aebe509b6c47abf87f8933cbe7fa..6dbe5d88b63f74b5210f0d6c8adbefb5e04be217 100644
--- a/chrome/utility/importer/ie_importer_win.cc
+++ b/chrome/utility/importer/ie_importer_win.cc
@@ -58,13 +58,13 @@ const char16 kFaviconStreamName[] = L":favicon:$DATA";
// A struct that hosts the information of AutoComplete data in PStore.
struct AutoCompleteInfo {
- string16 key;
- std::vector<string16> data;
+ base::string16 key;
+ std::vector<base::string16> data;
bool is_url;
};
// Gets the creation time of the given file or directory.
-base::Time GetFileCreationTime(const string16& file) {
+base::Time GetFileCreationTime(const base::string16& file) {
base::Time creation_time;
base::win::ScopedHandle file_handle(
CreateFile(file.c_str(), GENERIC_READ,
@@ -266,7 +266,7 @@ void SortBookmarksInIEOrder(
// Reads an internet shortcut (*.url) |file| and returns a COM object
// representing it.
bool LoadInternetShortcut(
- const string16& file,
+ const base::string16& file,
base::win::ScopedComPtr<IUniformResourceLocator>* shortcut) {
base::win::ScopedComPtr<IUniformResourceLocator> url_locator;
if (FAILED(url_locator.CreateInstance(CLSID_InternetShortcut, NULL,
@@ -320,7 +320,7 @@ GURL ReadFaviconURLFromInternetShortcut(IUniformResourceLocator* url_locator) {
// Reads the favicon imaga data in an NTFS alternate data stream. This is where
// IE7 and above store the data.
-bool ReadFaviconDataFromInternetShortcut(const string16& file,
+bool ReadFaviconDataFromInternetShortcut(const base::string16& file,
std::string* data) {
return base::ReadFileToString(
base::FilePath(file + kFaviconStreamName), data);
@@ -349,7 +349,7 @@ bool ReadFaviconDataFromCache(const GURL& favicon_url, std::string* data) {
// Reads the binary image data of favicon of an internet shortcut file |file|.
// |favicon_url| read by ReadFaviconURLFromInternetShortcut is also needed to
// examine the IE cache.
-bool ReadReencodedFaviconData(const string16& file,
+bool ReadReencodedFaviconData(const base::string16& file,
const GURL& favicon_url,
std::vector<unsigned char>* data) {
std::string image_data;
@@ -364,11 +364,10 @@ bool ReadReencodedFaviconData(const string16& file,
}
// Loads favicon image data and registers to |favicon_map|.
-void UpdateFaviconMap(
- const string16& url_file,
- const GURL& url,
- IUniformResourceLocator* url_locator,
- std::map<GURL, ImportedFaviconUsage>* favicon_map) {
+void UpdateFaviconMap(const base::string16& url_file,
+ const GURL& url,
+ IUniformResourceLocator* url_locator,
+ std::map<GURL, ImportedFaviconUsage>* favicon_map) {
GURL favicon_url = ReadFaviconURLFromInternetShortcut(url_locator);
if (!favicon_url.is_valid())
return;
@@ -460,7 +459,7 @@ void IEImporter::ImportFavorites() {
ParseFavoritesFolder(info, &bookmarks, &favicons);
if (!bookmarks.empty() && !cancelled()) {
- const string16& first_folder_name =
+ const base::string16& first_folder_name =
l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_IE);
bridge_->AddBookmarks(bookmarks, first_folder_name);
}
@@ -488,12 +487,12 @@ void IEImporter::ImportHistory() {
ULONG fetched;
while (!cancelled() &&
(result = enum_url->Next(1, &stat_url, &fetched)) == S_OK) {
- string16 url_string;
+ base::string16 url_string;
if (stat_url.pwcsUrl) {
url_string = stat_url.pwcsUrl;
CoTaskMemFree(stat_url.pwcsUrl);
}
- string16 title_string;
+ base::string16 title_string;
if (stat_url.pwcsTitle) {
title_string = stat_url.pwcsTitle;
CoTaskMemFree(stat_url.pwcsTitle);
@@ -575,16 +574,16 @@ void IEImporter::ImportPasswordsIE6() {
if (SUCCEEDED(result)) {
AutoCompleteInfo ac;
ac.key = item_name;
- string16 data;
+ base::string16 data;
data.insert(0, reinterpret_cast<wchar_t*>(buffer),
length / sizeof(wchar_t));
// The key name is always ended with ":StringData".
const wchar_t kDataSuffix[] = L":StringData";
size_t i = ac.key.rfind(kDataSuffix);
- if (i != string16::npos && ac.key.substr(i) == kDataSuffix) {
+ if (i != base::string16::npos && ac.key.substr(i) == kDataSuffix) {
ac.key.erase(i);
- ac.is_url = (ac.key.find(L"://") != string16::npos);
+ ac.is_url = (ac.key.find(L"://") != base::string16::npos);
ac_list.push_back(ac);
base::SplitString(data, L'\0', &ac_list[ac_list.size() - 1].data);
}
@@ -676,15 +675,15 @@ void IEImporter::ImportSearchEngines() {
// Software\Microsoft\Internet Explorer\SearchScopes
// Each key represents a search engine. The URL value contains the URL and
// the DisplayName the name.
- typedef std::map<std::string, string16> SearchEnginesMap;
+ typedef std::map<std::string, base::string16> SearchEnginesMap;
SearchEnginesMap search_engines_map;
for (base::win::RegistryKeyIterator key_iter(HKEY_CURRENT_USER,
kSearchScopePath); key_iter.Valid(); ++key_iter) {
- string16 sub_key_name = kSearchScopePath;
+ base::string16 sub_key_name = kSearchScopePath;
sub_key_name.append(L"\\").append(key_iter.Name());
base::win::RegKey sub_key(HKEY_CURRENT_USER, sub_key_name.c_str(),
KEY_READ);
- string16 wide_url;
+ base::string16 wide_url;
if ((sub_key.ReadValue(L"URL", &wide_url) != ERROR_SUCCESS) ||
wide_url.empty()) {
VLOG(1) << "No URL for IE search engine at " << key_iter.Name();
@@ -693,7 +692,7 @@ void IEImporter::ImportSearchEngines() {
// For the name, we try the default value first (as Live Search uses a
// non displayable name in DisplayName, and the readable name under the
// default value).
- string16 name;
+ base::string16 name;
if ((sub_key.ReadValue(NULL, &name) != ERROR_SUCCESS) || name.empty()) {
// Try the displayable name.
if ((sub_key.ReadValue(L"DisplayName", &name) != ERROR_SUCCESS) ||
@@ -732,7 +731,7 @@ void IEImporter::ImportHomepage() {
base::string16 key_path(importer::GetIESettingsKey());
base::win::RegKey key(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ);
- string16 homepage_url;
+ base::string16 homepage_url;
if (key.ReadValue(kIEHomepage, &homepage_url) != ERROR_SUCCESS ||
homepage_url.empty())
return;
@@ -743,7 +742,7 @@ void IEImporter::ImportHomepage() {
// Check to see if this is the default website and skip import.
base::win::RegKey keyDefault(HKEY_LOCAL_MACHINE, key_path.c_str(), KEY_READ);
- string16 default_homepage_url;
+ base::string16 default_homepage_url;
LONG result = keyDefault.ReadValue(kIEDefaultHomepage, &default_homepage_url);
if (result == ERROR_SUCCESS && !default_homepage_url.empty()) {
if (homepage.spec() == GURL(default_homepage_url).spec())
« no previous file with comments | « chrome/utility/importer/ie_importer_win.h ('k') | chrome/utility/importer/nss_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698