OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/field_trial.h" | 10 #include "base/field_trial.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // local state from the parent profile. | 275 // local state from the parent profile. |
276 // Checking that the local state file for the current profile doesn't exist | 276 // Checking that the local state file for the current profile doesn't exist |
277 // is the most robust way to determine whether we need to inherit or not | 277 // is the most robust way to determine whether we need to inherit or not |
278 // since the parent profile command line flag can be present even when the | 278 // since the parent profile command line flag can be present even when the |
279 // current profile is not a new one, and in that case we do not want to | 279 // current profile is not a new one, and in that case we do not want to |
280 // inherit and reset the user's setting. | 280 // inherit and reset the user's setting. |
281 if (!local_state_file_exists && | 281 if (!local_state_file_exists && |
282 parsed_command_line.HasSwitch(switches::kParentProfile)) { | 282 parsed_command_line.HasSwitch(switches::kParentProfile)) { |
283 FilePath parent_profile = FilePath::FromWStringHack( | 283 FilePath parent_profile = FilePath::FromWStringHack( |
284 parsed_command_line.GetSwitchValue(switches::kParentProfile)); | 284 parsed_command_line.GetSwitchValue(switches::kParentProfile)); |
285 PrefService parent_local_state(parent_profile); | 285 PrefService parent_local_state(parent_profile, |
| 286 g_browser_process->file_thread()); |
286 parent_local_state.RegisterStringPref(prefs::kApplicationLocale, | 287 parent_local_state.RegisterStringPref(prefs::kApplicationLocale, |
287 std::wstring()); | 288 std::wstring()); |
288 // Right now, we only inherit the locale setting from the parent profile. | 289 // Right now, we only inherit the locale setting from the parent profile. |
289 local_state->SetString( | 290 local_state->SetString( |
290 prefs::kApplicationLocale, | 291 prefs::kApplicationLocale, |
291 parent_local_state.GetString(prefs::kApplicationLocale)); | 292 parent_local_state.GetString(prefs::kApplicationLocale)); |
292 } | 293 } |
293 | 294 |
294 // If we're running tests (ui_task is non-null), then the ResourceBundle | 295 // If we're running tests (ui_task is non-null), then the ResourceBundle |
295 // has already been initialized. | 296 // has already been initialized. |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 if (metrics) | 615 if (metrics) |
615 metrics->Stop(); | 616 metrics->Stop(); |
616 | 617 |
617 // browser_shutdown takes care of deleting browser_process, so we need to | 618 // browser_shutdown takes care of deleting browser_process, so we need to |
618 // release it. | 619 // release it. |
619 browser_process.release(); | 620 browser_process.release(); |
620 browser_shutdown::Shutdown(); | 621 browser_shutdown::Shutdown(); |
621 | 622 |
622 return result_code; | 623 return result_code; |
623 } | 624 } |
OLD | NEW |