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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 // profile. | 419 // profile. |
420 ListPrefUpdate update(g_browser_process->local_state(), | 420 ListPrefUpdate update(g_browser_process->local_state(), |
421 prefs::kProfilesLastActive); | 421 prefs::kProfilesLastActive); |
422 base::ListValue* profile_list = update.Get(); | 422 base::ListValue* profile_list = update.Get(); |
423 profile_list->Clear(); | 423 profile_list->Clear(); |
424 } | 424 } |
425 | 425 |
426 Profile* profile = nullptr; | 426 Profile* profile = nullptr; |
427 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 427 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
428 // On ChromeOS and Android the ProfileManager will use the same path as the | 428 // On ChromeOS and Android the ProfileManager will use the same path as the |
429 // one we got passed. GetActiveUserProfile will therefore use the correct path | 429 // one we got passed. GetActiveUserProfile will therefore use the correct path |
emaxx
2017/06/08 19:43:53
nit: s/GetActiveUserProfile/CreateInitialProfile/
xiyuan
2017/06/08 20:30:40
Done.
| |
430 // automatically. | 430 // automatically. |
431 DCHECK_EQ(user_data_dir.value(), | 431 DCHECK_EQ(user_data_dir.value(), |
432 g_browser_process->profile_manager()->user_data_dir().value()); | 432 g_browser_process->profile_manager()->user_data_dir().value()); |
433 profile = ProfileManager::GetActiveUserProfile(); | 433 profile = ProfileManager::CreateInitialProfile(); |
434 | 434 |
435 // TODO(port): fix this. See comments near the definition of |user_data_dir|. | 435 // TODO(port): fix this. See comments near the definition of |user_data_dir|. |
436 // It is better to CHECK-fail here than it is to silently exit because of | 436 // It is better to CHECK-fail here than it is to silently exit because of |
437 // missing code in the above test. | 437 // missing code in the above test. |
438 CHECK(profile) << "Cannot get default profile."; | 438 CHECK(profile) << "Cannot get default profile."; |
439 | 439 |
440 #else | 440 #else |
441 profile = GetStartupProfile(user_data_dir, parsed_command_line); | 441 profile = GetStartupProfile(user_data_dir, parsed_command_line); |
442 | 442 |
443 if (!profile && !profile_dir_specified) | 443 if (!profile && !profile_dir_specified) |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2067 chromeos::CrosSettings::Shutdown(); | 2067 chromeos::CrosSettings::Shutdown(); |
2068 #endif // defined(OS_CHROMEOS) | 2068 #endif // defined(OS_CHROMEOS) |
2069 #endif // defined(OS_ANDROID) | 2069 #endif // defined(OS_ANDROID) |
2070 } | 2070 } |
2071 | 2071 |
2072 // Public members: | 2072 // Public members: |
2073 | 2073 |
2074 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2074 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
2075 chrome_extra_parts_.push_back(parts); | 2075 chrome_extra_parts_.push_back(parts); |
2076 } | 2076 } |
OLD | NEW |