| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 // local state from the parent profile. | 436 // local state from the parent profile. |
| 437 // Checking that the local state file for the current profile doesn't exist | 437 // Checking that the local state file for the current profile doesn't exist |
| 438 // is the most robust way to determine whether we need to inherit or not | 438 // is the most robust way to determine whether we need to inherit or not |
| 439 // since the parent profile command line flag can be present even when the | 439 // since the parent profile command line flag can be present even when the |
| 440 // current profile is not a new one, and in that case we do not want to | 440 // current profile is not a new one, and in that case we do not want to |
| 441 // inherit and reset the user's setting. | 441 // inherit and reset the user's setting. |
| 442 if (!local_state_file_exists && | 442 if (!local_state_file_exists && |
| 443 parsed_command_line.HasSwitch(switches::kParentProfile)) { | 443 parsed_command_line.HasSwitch(switches::kParentProfile)) { |
| 444 FilePath parent_profile = FilePath::FromWStringHack( | 444 FilePath parent_profile = FilePath::FromWStringHack( |
| 445 parsed_command_line.GetSwitchValue(switches::kParentProfile)); | 445 parsed_command_line.GetSwitchValue(switches::kParentProfile)); |
| 446 PrefService parent_local_state(parent_profile, | 446 PrefService parent_local_state(parent_profile); |
| 447 g_browser_process->file_thread()); | |
| 448 parent_local_state.RegisterStringPref(prefs::kApplicationLocale, | 447 parent_local_state.RegisterStringPref(prefs::kApplicationLocale, |
| 449 std::wstring()); | 448 std::wstring()); |
| 450 // Right now, we only inherit the locale setting from the parent profile. | 449 // Right now, we only inherit the locale setting from the parent profile. |
| 451 local_state->SetString( | 450 local_state->SetString( |
| 452 prefs::kApplicationLocale, | 451 prefs::kApplicationLocale, |
| 453 parent_local_state.GetString(prefs::kApplicationLocale)); | 452 parent_local_state.GetString(prefs::kApplicationLocale)); |
| 454 } | 453 } |
| 455 | 454 |
| 456 // If we're running tests (ui_task is non-null), then the ResourceBundle | 455 // If we're running tests (ui_task is non-null), then the ResourceBundle |
| 457 // has already been initialized. | 456 // has already been initialized. |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 if (metrics) | 886 if (metrics) |
| 888 metrics->Stop(); | 887 metrics->Stop(); |
| 889 | 888 |
| 890 // browser_shutdown takes care of deleting browser_process, so we need to | 889 // browser_shutdown takes care of deleting browser_process, so we need to |
| 891 // release it. | 890 // release it. |
| 892 browser_process.release(); | 891 browser_process.release(); |
| 893 browser_shutdown::Shutdown(); | 892 browser_shutdown::Shutdown(); |
| 894 | 893 |
| 895 return result_code; | 894 return result_code; |
| 896 } | 895 } |
| OLD | NEW |