From dc9a67601b9d8c952bf399f0309519273f82bfd5 Mon Sep 17 00:00:00 2001 From: "viettrungluu@chromium.org" Date: Mon, 16 Aug 2010 07:13:53 +0000 Subject: Remove deprecated wstring Get(As)String() methods from Value, etc. BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3117017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56187 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/first_run/first_run_gtk.cc | 7 +++++-- chrome/browser/first_run/first_run_win.cc | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'chrome/browser/first_run') diff --git a/chrome/browser/first_run/first_run_gtk.cc b/chrome/browser/first_run/first_run_gtk.cc index 725cdd0..0f6e7db 100644 --- a/chrome/browser/first_run/first_run_gtk.cc +++ b/chrome/browser/first_run/first_run_gtk.cc @@ -9,7 +9,9 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/process_util.h" +#include "base/string_piece.h" #include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/gtk/first_run_dialog.h" #include "chrome/browser/profile_manager.h" @@ -103,14 +105,15 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, if (!FirstRun::CreateSentinel()) return false; - std::wstring import_bookmarks_path; + std::string import_bookmarks_path; installer_util::GetDistroStringPreference(prefs.get(), installer_util::master_preferences::kDistroImportBookmarksFromFilePref, &import_bookmarks_path); if (!import_bookmarks_path.empty()) { // There are bookmarks to import from a file. - FilePath path = FilePath::FromWStringHack(import_bookmarks_path); + FilePath path = FilePath::FromWStringHack( + UTF8ToWide(import_bookmarks_path)); if (!FirstRun::ImportBookmarks(path)) { LOG(WARNING) << "silent bookmark import failed"; } diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 6cfc233..57a15c2 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -391,7 +391,7 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, value) FirstRun::SetShowWelcomePagePref(); - std::wstring import_bookmarks_path; + std::string import_bookmarks_path; installer_util::GetDistroStringPreference(prefs.get(), installer_util::master_preferences::kDistroImportBookmarksFromFilePref, &import_bookmarks_path); @@ -401,8 +401,9 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, // the importer process and blocks until done or until it fails. scoped_refptr importer_host = new ImporterHost(); if (!FirstRun::ImportSettings(NULL, - importer_host->GetSourceProfileInfoAt(0).browser_type, - import_items, FilePath(import_bookmarks_path), true, NULL)) { + importer_host->GetSourceProfileInfoAt(0).browser_type, import_items, + FilePath::FromWStringHack(UTF8ToWide(import_bookmarks_path)), + true, NULL)) { LOG(WARNING) << "silent import failed"; } } -- cgit v1.1