| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // If the local state file for the current profile doesn't exist and the | 286 // If the local state file for the current profile doesn't exist and the |
| 287 // parent profile command line flag is present, then we should inherit some | 287 // parent profile command line flag is present, then we should inherit some |
| 288 // local state from the parent profile. | 288 // local state from the parent profile. |
| 289 // Checking that the local state file for the current profile doesn't exist | 289 // Checking that the local state file for the current profile doesn't exist |
| 290 // is the most robust way to determine whether we need to inherit or not | 290 // is the most robust way to determine whether we need to inherit or not |
| 291 // since the parent profile command line flag can be present even when the | 291 // since the parent profile command line flag can be present even when the |
| 292 // current profile is not a new one, and in that case we do not want to | 292 // current profile is not a new one, and in that case we do not want to |
| 293 // inherit and reset the user's setting. | 293 // inherit and reset the user's setting. |
| 294 if (!local_state_file_exists && | 294 if (!local_state_file_exists && |
| 295 parsed_command_line.HasSwitch(switches::kParentProfile)) { | 295 parsed_command_line.HasSwitch(switches::kParentProfile)) { |
| 296 std::wstring parent_profile = | 296 FilePath parent_profile = FilePath::FromWStringHack( |
| 297 parsed_command_line.GetSwitchValue(switches::kParentProfile); | 297 parsed_command_line.GetSwitchValue(switches::kParentProfile)); |
| 298 PrefService parent_local_state(parent_profile); | 298 PrefService parent_local_state(parent_profile); |
| 299 parent_local_state.RegisterStringPref(prefs::kApplicationLocale, | 299 parent_local_state.RegisterStringPref(prefs::kApplicationLocale, |
| 300 std::wstring()); | 300 std::wstring()); |
| 301 // Right now, we only inherit the locale setting from the parent profile. | 301 // Right now, we only inherit the locale setting from the parent profile. |
| 302 local_state->SetString( | 302 local_state->SetString( |
| 303 prefs::kApplicationLocale, | 303 prefs::kApplicationLocale, |
| 304 parent_local_state.GetString(prefs::kApplicationLocale)); | 304 parent_local_state.GetString(prefs::kApplicationLocale)); |
| 305 } | 305 } |
| 306 | 306 |
| 307 // If we're running tests (ui_task is non-null), then the ResourceBundle | 307 // If we're running tests (ui_task is non-null), then the ResourceBundle |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 if (metrics) | 565 if (metrics) |
| 566 metrics->Stop(); | 566 metrics->Stop(); |
| 567 | 567 |
| 568 // browser_shutdown takes care of deleting browser_process, so we need to | 568 // browser_shutdown takes care of deleting browser_process, so we need to |
| 569 // release it. | 569 // release it. |
| 570 browser_process.release(); | 570 browser_process.release(); |
| 571 browser_shutdown::Shutdown(); | 571 browser_shutdown::Shutdown(); |
| 572 | 572 |
| 573 return result_code; | 573 return result_code; |
| 574 } | 574 } |
| OLD | NEW |