Commit 6974f8d6 authored by tfarina@chromium.org's avatar tfarina@chromium.org

importer: Convert the remaining wstrings to string16.

BUG=43460
R=mirandac@chromium.org

Review URL: http://codereview.chromium.org/8848003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113464 0039d316-1c4b-4281-b951-d872f2087c98
parent 45aedebe
...@@ -380,28 +380,30 @@ void Firefox3Importer::GetSearchEnginesXMLFiles( ...@@ -380,28 +380,30 @@ void Firefox3Importer::GetSearchEnginesXMLFiles(
// user has added a engine. So we get search engines from sqlite db as well // user has added a engine. So we get search engines from sqlite db as well
// as from the file system. // as from the file system.
if (s.Step()) { if (s.Step()) {
const std::wstring kAppPrefix = L"[app]/"; const std::string kAppPrefix("[app]/");
const std::wstring kProfilePrefix = L"[profile]/"; const std::string kProfilePrefix("[profile]/");
do { do {
FilePath file; FilePath file;
std::wstring engine = UTF8ToWide(s.ColumnString(0)); std::string engine(s.ColumnString(0));
// The string contains [app]/<name>.xml or [profile]/<name>.xml where // The string contains [app]/<name>.xml or [profile]/<name>.xml where
// the [app] and [profile] need to be replaced with the actual app or // the [app] and [profile] need to be replaced with the actual app or
// profile path. // profile path.
size_t index = engine.find(kAppPrefix); size_t index = engine.find(kAppPrefix);
if (index != std::wstring::npos) { if (index != std::string::npos) {
// Remove '[app]/'. // Remove '[app]/'.
file = app_path.Append(FilePath::FromWStringHack( file = app_path.AppendASCII(engine.substr(index + kAppPrefix.length()));
engine.substr(index + kAppPrefix.length()))); } else if ((index = engine.find(kProfilePrefix)) != std::string::npos) {
} else if ((index = engine.find(kProfilePrefix)) != std::wstring::npos) {
// Remove '[profile]/'. // Remove '[profile]/'.
file = profile_path.Append( file = profile_path.AppendASCII(
FilePath::FromWStringHack( engine.substr(index + kProfilePrefix.length()));
engine.substr(index + kProfilePrefix.length())));
} else { } else {
// Looks like absolute path to the file. // Looks like absolute path to the file.
file = FilePath::FromWStringHack(engine); #if defined(OS_WIN)
file = FilePath(UTF8ToWide(engine));
#else
file = FilePath(engine);
#endif
} }
files->push_back(file); files->push_back(file);
} while (s.Step() && !cancelled()); } while (s.Step() && !cancelled());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment