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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.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
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/ui/startup/startup_browser_creator.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> // For max(). 9 #include <algorithm> // For max().
10 #include <limits> 10 #include <limits>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "chrome/browser/profiles/profile_attributes_entry.h" 50 #include "chrome/browser/profiles/profile_attributes_entry.h"
51 #include "chrome/browser/profiles/profile_attributes_storage.h" 51 #include "chrome/browser/profiles/profile_attributes_storage.h"
52 #include "chrome/browser/profiles/profile_manager.h" 52 #include "chrome/browser/profiles/profile_manager.h"
53 #include "chrome/browser/profiles/profiles_state.h" 53 #include "chrome/browser/profiles/profiles_state.h"
54 #include "chrome/browser/search_engines/template_url_service_factory.h" 54 #include "chrome/browser/search_engines/template_url_service_factory.h"
55 #include "chrome/browser/ui/browser.h" 55 #include "chrome/browser/ui/browser.h"
56 #include "chrome/browser/ui/browser_dialogs.h" 56 #include "chrome/browser/ui/browser_dialogs.h"
57 #include "chrome/browser/ui/browser_finder.h" 57 #include "chrome/browser/ui/browser_finder.h"
58 #include "chrome/browser/ui/browser_window.h" 58 #include "chrome/browser/ui/browser_window.h"
59 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" 59 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
60 #include "chrome/browser/ui/startup/startup_features.h"
60 #include "chrome/browser/ui/user_manager.h" 61 #include "chrome/browser/ui/user_manager.h"
61 #include "chrome/browser/ui/webui/settings/reset_settings_handler.h" 62 #include "chrome/browser/ui/webui/settings/reset_settings_handler.h"
62 #include "chrome/common/chrome_constants.h" 63 #include "chrome/common/chrome_constants.h"
63 #include "chrome/common/chrome_paths.h" 64 #include "chrome/common/chrome_paths.h"
64 #include "chrome/common/chrome_result_codes.h" 65 #include "chrome/common/chrome_result_codes.h"
65 #include "chrome/common/chrome_switches.h" 66 #include "chrome/common/chrome_switches.h"
66 #include "chrome/common/features.h" 67 #include "chrome/common/features.h"
67 #include "chrome/common/pref_names.h" 68 #include "chrome/common/pref_names.h"
68 #include "chrome/common/url_constants.h" 69 #include "chrome/common/url_constants.h"
69 #include "components/google/core/browser/google_util.h" 70 #include "components/google/core/browser/google_util.h"
(...skipping 25 matching lines...) Expand all
95 96
96 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) 97 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX)
97 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck 98 #include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck
98 #endif 99 #endif
99 100
100 #if defined(OS_MACOSX) 101 #if defined(OS_MACOSX)
101 #include "chrome/browser/web_applications/web_app_mac.h" 102 #include "chrome/browser/web_applications/web_app_mac.h"
102 #endif 103 #endif
103 104
104 #if defined(OS_WIN) 105 #if defined(OS_WIN)
106 #include "base/win/windows_version.h"
105 #include "chrome/browser/metrics/jumplist_metrics_win.h" 107 #include "chrome/browser/metrics/jumplist_metrics_win.h"
106 #endif 108 #endif
107 109
108 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) 110 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
109 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 111 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
110 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" 112 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h"
111 #include "chrome/browser/printing/print_dialog_cloud.h" 113 #include "chrome/browser/printing/print_dialog_cloud.h"
112 #endif 114 #endif
113 115
114 #if BUILDFLAG(ENABLE_APP_LIST) 116 #if BUILDFLAG(ENABLE_APP_LIST)
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 487
486 // static 488 // static
487 void StartupBrowserCreator::RegisterProfilePrefs(PrefRegistrySimple* registry) { 489 void StartupBrowserCreator::RegisterProfilePrefs(PrefRegistrySimple* registry) {
488 // Default to true so that existing users are not shown the Welcome page. 490 // Default to true so that existing users are not shown the Welcome page.
489 // ProfileManager handles setting this to false for new profiles upon 491 // ProfileManager handles setting this to false for new profiles upon
490 // creation. 492 // creation.
491 registry->RegisterBooleanPref(prefs::kHasSeenWelcomePage, true); 493 registry->RegisterBooleanPref(prefs::kHasSeenWelcomePage, true);
492 } 494 }
493 495
494 // static 496 // static
497 bool StartupBrowserCreator::UseConsolidatedFlow() {
498 #if defined(OS_WIN)
499 if (base::win::GetVersion() >= base::win::VERSION_WIN10)
500 return base::FeatureList::IsEnabled(features::kEnableWelcomeWin10);
501 #endif // defined(OS_WIN)
502 return base::FeatureList::IsEnabled(features::kUseConsolidatedStartupFlow);
503 }
504
505 // static
495 std::vector<GURL> StartupBrowserCreator::GetURLsFromCommandLine( 506 std::vector<GURL> StartupBrowserCreator::GetURLsFromCommandLine(
496 const base::CommandLine& command_line, 507 const base::CommandLine& command_line,
497 const base::FilePath& cur_dir, 508 const base::FilePath& cur_dir,
498 Profile* profile) { 509 Profile* profile) {
499 DCHECK(profile); 510 DCHECK(profile);
500 511
501 std::vector<GURL> urls; 512 std::vector<GURL> urls;
502 513
503 const base::CommandLine::StringVector& params = command_line.GetArgs(); 514 const base::CommandLine::StringVector& params = command_line.GetArgs();
504 for (size_t i = 0; i < params.size(); ++i) { 515 for (size_t i = 0; i < params.size(); ++i) {
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 if (!entry->IsSigninRequired()) { 1020 if (!entry->IsSigninRequired()) {
1010 Profile* profile = profile_manager->GetProfile(entry->GetPath()); 1021 Profile* profile = profile_manager->GetProfile(entry->GetPath());
1011 if (profile) 1022 if (profile)
1012 return profile; 1023 return profile;
1013 } 1024 }
1014 } 1025 }
1015 1026
1016 return nullptr; 1027 return nullptr;
1017 } 1028 }
1018 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 1029 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.h ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698