| OLD | NEW |
| 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/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 cmdline.GetSwitchValuePath(switches::kUserDataDir)); | 44 cmdline.GetSwitchValuePath(switches::kUserDataDir)); |
| 45 } | 45 } |
| 46 // Since ImportSettings is called before the local state is stored on disk | 46 // Since ImportSettings is called before the local state is stored on disk |
| 47 // we pass the language as an argument. GetApplicationLocale checks the | 47 // we pass the language as an argument. GetApplicationLocale checks the |
| 48 // current command line as fallback. | 48 // current command line as fallback. |
| 49 import_cmd.AppendSwitchASCII(switches::kLang, | 49 import_cmd.AppendSwitchASCII(switches::kLang, |
| 50 g_browser_process->GetApplicationLocale()); | 50 g_browser_process->GetApplicationLocale()); |
| 51 | 51 |
| 52 import_cmd.CommandLine::AppendSwitchPath(switches::kImportFromFile, | 52 import_cmd.CommandLine::AppendSwitchPath(switches::kImportFromFile, |
| 53 import_bookmarks_path); | 53 import_bookmarks_path); |
| 54 |
| 55 // The importer doesn't need to do any background networking tasks so disable |
| 56 // them. |
| 57 import_cmd.CommandLine::AppendSwitch(switches::kDisableBackgroundNetworking); |
| 58 |
| 54 // Time to launch the process that is going to do the import. We'll wait | 59 // Time to launch the process that is going to do the import. We'll wait |
| 55 // for the process to return. | 60 // for the process to return. |
| 56 base::LaunchOptions options; | 61 base::LaunchOptions options; |
| 57 options.wait = true; | 62 options.wait = true; |
| 58 return base::LaunchProcess(import_cmd, options, NULL); | 63 return base::LaunchProcess(import_cmd, options, NULL); |
| 59 } | 64 } |
| 60 | 65 |
| 61 } // namespace internal | 66 } // namespace internal |
| 62 } // namespace first_run | 67 } // namespace first_run |
| 63 | 68 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 100 |
| 96 FilePath MasterPrefsPath() { | 101 FilePath MasterPrefsPath() { |
| 97 // The standard location of the master prefs is next to the chrome binary. | 102 // The standard location of the master prefs is next to the chrome binary. |
| 98 FilePath master_prefs; | 103 FilePath master_prefs; |
| 99 if (!PathService::Get(base::DIR_EXE, &master_prefs)) | 104 if (!PathService::Get(base::DIR_EXE, &master_prefs)) |
| 100 return FilePath(); | 105 return FilePath(); |
| 101 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); | 106 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); |
| 102 } | 107 } |
| 103 | 108 |
| 104 } // namespace first_run | 109 } // namespace first_run |
| OLD | NEW |