summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 17:42:24 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 17:42:24 +0000
commitb488ea7872d49c212507c7b4827a74aa5501fbc6 (patch)
tree862ce114b65efee4ad6dd91428ae8b1de709c0ab /chrome/browser/first_run
parent009aa841199a2786b5eb760a86c40ec568011e57 (diff)
downloadchromium_src-b488ea7872d49c212507c7b4827a74aa5501fbc6.zip
chromium_src-b488ea7872d49c212507c7b4827a74aa5501fbc6.tar.gz
chromium_src-b488ea7872d49c212507c7b4827a74aa5501fbc6.tar.bz2
Use a few more FilePaths in bookmark import.
Removes some wstrings. BUG=24672 Review URL: http://codereview.chromium.org/2819080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r--chrome/browser/first_run/first_run.h4
-rw-r--r--chrome/browser/first_run/first_run_gtk.cc9
-rw-r--r--chrome/browser/first_run/first_run_win.cc10
3 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/first_run/first_run.h b/chrome/browser/first_run/first_run.h
index e83282f..f7996c0 100644
--- a/chrome/browser/first_run/first_run.h
+++ b/chrome/browser/first_run/first_run.h
@@ -135,13 +135,13 @@ class FirstRun {
// public version.
static bool ImportSettings(Profile* profile, int browser_type,
int items_to_import,
- const std::wstring& import_path,
+ const FilePath& import_path,
gfx::NativeView parent_window);
// Import browser items in this process. The browser and the items to
// import are encoded int the command line.
static int ImportFromBrowser(Profile* profile, const CommandLine& cmdline);
#elif defined(OS_LINUX)
- static bool ImportBookmarks(const std::wstring& import_bookmarks_path);
+ static bool ImportBookmarks(const FilePath& import_bookmarks_path);
#endif
// Import bookmarks from an html file. The path to the file is provided in
diff --git a/chrome/browser/first_run/first_run_gtk.cc b/chrome/browser/first_run/first_run_gtk.cc
index d533823..7679b4f 100644
--- a/chrome/browser/first_run/first_run_gtk.cc
+++ b/chrome/browser/first_run/first_run_gtk.cc
@@ -106,7 +106,8 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
if (!import_bookmarks_path.empty()) {
// There are bookmarks to import from a file.
- if (!FirstRun::ImportBookmarks(import_bookmarks_path)) {
+ FilePath path = FilePath::FromWStringHack(import_bookmarks_path);
+ if (!FirstRun::ImportBookmarks(path)) {
LOG(WARNING) << "silent bookmark import failed";
}
}
@@ -115,7 +116,7 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
// TODO(port): This is just a piece of the silent import functionality from
// ImportSettings for Windows. It would be nice to get the rest of it ported.
-bool FirstRun::ImportBookmarks(const std::wstring& import_bookmarks_path) {
+bool FirstRun::ImportBookmarks(const FilePath& import_bookmarks_path) {
const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
CommandLine import_cmd(cmdline.GetProgram());
@@ -130,8 +131,8 @@ bool FirstRun::ImportBookmarks(const std::wstring& import_bookmarks_path) {
import_cmd.AppendSwitchASCII(switches::kLang,
g_browser_process->GetApplicationLocale());
- import_cmd.CommandLine::AppendSwitchWithValue(
- switches::kImportFromFile, import_bookmarks_path);
+ import_cmd.CommandLine::AppendSwitchPath(switches::kImportFromFile,
+ import_bookmarks_path);
// Time to launch the process that is going to do the import. We'll wait
// for the process to return.
return base::LaunchApp(import_cmd, true, false, NULL);
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index ba1674f..6e2e1aa 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -399,7 +399,7 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
scoped_refptr<ImporterHost> importer_host = new ImporterHost();
if (!FirstRun::ImportSettings(NULL,
importer_host->GetSourceProfileInfoAt(0).browser_type,
- import_items, import_bookmarks_path, NULL)) {
+ import_items, FilePath(import_bookmarks_path), NULL)) {
LOG(WARNING) << "silent import failed";
}
}
@@ -679,7 +679,7 @@ void FirstRun::AutoImport(Profile* profile,
bool FirstRun::ImportSettings(Profile* profile, int browser_type,
int items_to_import,
- const std::wstring& import_bookmarks_path,
+ const FilePath& import_bookmarks_path,
HWND parent_window) {
const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
CommandLine import_cmd(cmdline.GetProgram());
@@ -703,8 +703,8 @@ bool FirstRun::ImportSettings(Profile* profile, int browser_type,
}
if (!import_bookmarks_path.empty()) {
- import_cmd.CommandLine::AppendSwitchWithValue(
- switches::kImportFromFile, import_bookmarks_path.c_str());
+ import_cmd.CommandLine::AppendSwitchPath(
+ switches::kImportFromFile, import_bookmarks_path);
}
// Time to launch the process that is going to do the import.
@@ -734,7 +734,7 @@ bool FirstRun::ImportSettings(Profile* profile, int browser_type,
int items_to_import,
HWND parent_window) {
return ImportSettings(profile, browser_type, items_to_import,
- std::wstring(), parent_window);
+ FilePath(), parent_window);
}
int FirstRun::ImportFromBrowser(Profile* profile,