Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 2775773003: [Desktop FRE] Do not show Welcome page to profiles created in M56 or M57 (Closed)
Patch Set: remove pref null check Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "chrome/browser/signin/account_fetcher_service_factory.h" 50 #include "chrome/browser/signin/account_fetcher_service_factory.h"
51 #include "chrome/browser/signin/account_reconcilor_factory.h" 51 #include "chrome/browser/signin/account_reconcilor_factory.h"
52 #include "chrome/browser/signin/account_tracker_service_factory.h" 52 #include "chrome/browser/signin/account_tracker_service_factory.h"
53 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" 53 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h"
54 #include "chrome/browser/signin/signin_manager_factory.h" 54 #include "chrome/browser/signin/signin_manager_factory.h"
55 #include "chrome/browser/signin/signin_util.h" 55 #include "chrome/browser/signin/signin_util.h"
56 #include "chrome/browser/sync/profile_sync_service_factory.h" 56 #include "chrome/browser/sync/profile_sync_service_factory.h"
57 #include "chrome/browser/ui/browser.h" 57 #include "chrome/browser/ui/browser.h"
58 #include "chrome/browser/ui/browser_finder.h" 58 #include "chrome/browser/ui/browser_finder.h"
59 #include "chrome/browser/ui/browser_list.h" 59 #include "chrome/browser/ui/browser_list.h"
60 #include "chrome/browser/ui/startup/startup_browser_creator.h"
60 #include "chrome/browser/ui/sync/sync_promo_ui.h" 61 #include "chrome/browser/ui/sync/sync_promo_ui.h"
61 #include "chrome/common/chrome_constants.h" 62 #include "chrome/common/chrome_constants.h"
62 #include "chrome/common/chrome_paths_internal.h" 63 #include "chrome/common/chrome_paths_internal.h"
63 #include "chrome/common/chrome_switches.h" 64 #include "chrome/common/chrome_switches.h"
64 #include "chrome/common/features.h" 65 #include "chrome/common/features.h"
65 #include "chrome/common/logging_chrome.h" 66 #include "chrome/common/logging_chrome.h"
66 #include "chrome/common/pref_names.h" 67 #include "chrome/common/pref_names.h"
67 #include "chrome/common/url_constants.h" 68 #include "chrome/common/url_constants.h"
68 #include "chrome/grit/generated_resources.h" 69 #include "chrome/grit/generated_resources.h"
69 #include "components/bookmarks/browser/bookmark_model.h" 70 #include "components/bookmarks/browser/bookmark_model.h"
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 if (force_supervised_user_id) { 990 if (force_supervised_user_id) {
990 supervised_user_id = 991 supervised_user_id =
991 command_line->GetSwitchValueASCII(switches::kSupervisedUserId); 992 command_line->GetSwitchValueASCII(switches::kSupervisedUserId);
992 } 993 }
993 if (force_supervised_user_id || 994 if (force_supervised_user_id ||
994 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { 995 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) {
995 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, 996 profile->GetPrefs()->SetString(prefs::kSupervisedUserId,
996 supervised_user_id); 997 supervised_user_id);
997 } 998 }
998 #if !defined(OS_ANDROID) 999 #if !defined(OS_ANDROID)
999 // TODO(pmonette): Fix IsNewProfile() to handle the case where the profile is 1000 if (StartupBrowserCreator::UseConsolidatedFlow()) {
1000 // new even if the "Preferences" file already existed (For example: The 1001 // TODO(pmonette): Fix IsNewProfile() to handle the case where the profile
1001 // master_preferences file is dumped into the default profile on first run, 1002 // is new even if the "Preferences" file already existed (For example: The
1002 // before profile creation). 1003 // master_preferences file is dumped into the default profile on first run,
1003 if (profile->IsNewProfile() || first_run::IsChromeFirstRun()) 1004 // before profile creation).
1004 profile->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, false); 1005 if (profile->IsNewProfile() || first_run::IsChromeFirstRun())
1006 profile->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, false);
1007 }
1005 #endif 1008 #endif
1006 } 1009 }
1007 1010
1008 void ProfileManager::RegisterTestingProfile(Profile* profile, 1011 void ProfileManager::RegisterTestingProfile(Profile* profile,
1009 bool add_to_storage, 1012 bool add_to_storage,
1010 bool start_deferred_task_runners) { 1013 bool start_deferred_task_runners) {
1011 RegisterProfile(profile, true); 1014 RegisterProfile(profile, true);
1012 if (add_to_storage) { 1015 if (add_to_storage) {
1013 InitProfileUserPrefs(profile); 1016 InitProfileUserPrefs(profile);
1014 AddProfileToStorage(profile); 1017 AddProfileToStorage(profile);
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 1796
1794 const base::FilePath new_active_profile_dir = 1797 const base::FilePath new_active_profile_dir =
1795 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); 1798 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath();
1796 FinishDeletingProfile(profile_dir, new_active_profile_dir); 1799 FinishDeletingProfile(profile_dir, new_active_profile_dir);
1797 } 1800 }
1798 #endif // !defined(OS_ANDROID) 1801 #endif // !defined(OS_ANDROID)
1799 1802
1800 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1803 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1801 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1804 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1802 } 1805 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698