| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compiler_specific.h" | 8 #include "base/compiler_specific.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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 #endif | 143 #endif |
| 144 } | 144 } |
| 145 return return_code; | 145 return return_code; |
| 146 } | 146 } |
| 147 | 147 |
| 148 // static | 148 // static |
| 149 bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, | 149 bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, |
| 150 MasterPrefs* out_prefs) { | 150 MasterPrefs* out_prefs) { |
| 151 DCHECK(!user_data_dir.empty()); | 151 DCHECK(!user_data_dir.empty()); |
| 152 | 152 |
| 153 // The standard location of the master prefs is next to the chrome binary. | 153 FilePath master_prefs = MasterPrefsPath(); |
| 154 FilePath master_prefs; | 154 if (master_prefs.empty()) |
| 155 if (!PathService::Get(base::DIR_EXE, &master_prefs)) | |
| 156 return true; | 155 return true; |
| 157 master_prefs = master_prefs.AppendASCII(installer::kDefaultMasterPrefs); | |
| 158 installer::MasterPreferences prefs(master_prefs); | 156 installer::MasterPreferences prefs(master_prefs); |
| 159 if (!prefs.read_from_file()) | 157 if (!prefs.read_from_file()) |
| 160 return true; | 158 return true; |
| 161 | 159 |
| 162 out_prefs->new_tabs = prefs.GetFirstRunTabs(); | 160 out_prefs->new_tabs = prefs.GetFirstRunTabs(); |
| 163 | 161 |
| 164 bool value = false; | 162 bool value = false; |
| 165 | 163 |
| 166 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
| 167 // RLZ is currently a Windows-only phenomenon. When it comes to the Mac/ | 165 // RLZ is currently a Windows-only phenomenon. When it comes to the Mac/ |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 if (!observer->ended()) { | 715 if (!observer->ended()) { |
| 718 observer->set_should_quit_message_loop(); | 716 observer->set_should_quit_message_loop(); |
| 719 MessageLoop::current()->Run(); | 717 MessageLoop::current()->Run(); |
| 720 } | 718 } |
| 721 | 719 |
| 722 // Unfortunately there's no success/fail signal in ImporterHost. | 720 // Unfortunately there's no success/fail signal in ImporterHost. |
| 723 return true; | 721 return true; |
| 724 } | 722 } |
| 725 | 723 |
| 726 #endif // OS_POSIX | 724 #endif // OS_POSIX |
| OLD | NEW |