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

Side by Side Diff: chrome/browser/first_run/first_run_linux.cc

Issue 12670013: Out-of-process import on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on top of https://codereview.chromium.org/15736014/ Created 7 years, 7 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 | Annotate | Revision Log
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/browser/first_run/first_run.h" 5 #include "chrome/browser/first_run/first_run.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 13 matching lines...) Expand all
24 #include "ui/base/ui_base_switches.h" 24 #include "ui/base/ui_base_switches.h"
25 25
26 namespace first_run { 26 namespace first_run {
27 namespace internal { 27 namespace internal {
28 28
29 bool IsOrganicFirstRun() { 29 bool IsOrganicFirstRun() {
30 // We treat all installs as organic. 30 // We treat all installs as organic.
31 return true; 31 return true;
32 } 32 }
33 33
34 // TODO(port): This is just a piece of the silent import functionality from
35 // ImportSettings for Windows. It would be nice to get the rest of it ported.
36 bool ImportBookmarks(const base::FilePath& import_bookmarks_path) {
37 const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
38 CommandLine import_cmd(cmdline.GetProgram());
39
40 // Propagate user data directory switch.
41 if (cmdline.HasSwitch(switches::kUserDataDir)) {
42 import_cmd.AppendSwitchPath(switches::kUserDataDir,
43 cmdline.GetSwitchValuePath(switches::kUserDataDir));
44 }
45 // Since ImportSettings is called before the local state is stored on disk
46 // we pass the language as an argument. GetApplicationLocale checks the
47 // current command line as fallback.
48 import_cmd.AppendSwitchASCII(switches::kLang,
49 g_browser_process->GetApplicationLocale());
50
51 import_cmd.CommandLine::AppendSwitchPath(switches::kImportFromFile,
52 import_bookmarks_path);
53
54 // The importer doesn't need to do any background networking tasks so disable
55 // them.
56 import_cmd.CommandLine::AppendSwitch(switches::kDisableBackgroundNetworking);
57
58 // Time to launch the process that is going to do the import. We'll wait
59 // for the process to return.
60 base::LaunchOptions options;
61 options.wait = true;
62 return base::LaunchProcess(import_cmd, options, NULL);
63 }
64
65 base::FilePath MasterPrefsPath() { 34 base::FilePath MasterPrefsPath() {
66 // The standard location of the master prefs is next to the chrome binary. 35 // The standard location of the master prefs is next to the chrome binary.
67 base::FilePath master_prefs; 36 base::FilePath master_prefs;
68 if (!PathService::Get(base::DIR_EXE, &master_prefs)) 37 if (!PathService::Get(base::DIR_EXE, &master_prefs))
69 return base::FilePath(); 38 return base::FilePath();
70 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); 39 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs);
71 } 40 }
72 41
73 } // namespace internal 42 } // namespace internal
74 } // namespace first_run 43 } // namespace first_run
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run_internal.h ('k') | chrome/browser/first_run/first_run_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698