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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 11636031: [Fixit Dec-2012] Refactor first_run, very few things should depend on whether the First Run senti... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android and chromeos compile Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/chrome_browser_main_extra_parts.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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 result_code_(content::RESULT_CODE_NORMAL_EXIT), 480 result_code_(content::RESULT_CODE_NORMAL_EXIT),
481 startup_watcher_(new StartupTimeBomb()), 481 startup_watcher_(new StartupTimeBomb()),
482 shutdown_watcher_(new ShutdownWatcherHelper()), 482 shutdown_watcher_(new ShutdownWatcherHelper()),
483 startup_timer_(new performance_monitor::StartupTimer()), 483 startup_timer_(new performance_monitor::StartupTimer()),
484 browser_field_trials_(parameters.command_line), 484 browser_field_trials_(parameters.command_line),
485 record_search_engine_(false), 485 record_search_engine_(false),
486 translate_manager_(NULL), 486 translate_manager_(NULL),
487 profile_(NULL), 487 profile_(NULL),
488 run_message_loop_(true), 488 run_message_loop_(true),
489 notify_result_(ProcessSingleton::PROCESS_NONE), 489 notify_result_(ProcessSingleton::PROCESS_NONE),
490 is_first_run_(false), 490 do_first_run_tasks_(false),
Nico 2012/12/21 21:44:22 Shoudl this default to true?
gab 2012/12/21 22:10:35 No, it's only set to true if this is first run &&
491 first_run_ui_bypass_(false),
492 local_state_(NULL), 491 local_state_(NULL),
493 restart_last_session_(false) { 492 restart_last_session_(false) {
494 // If we're running tests (ui_task is non-null). 493 // If we're running tests (ui_task is non-null).
495 if (parameters.ui_task) 494 if (parameters.ui_task)
496 browser_defaults::enable_help_app = false; 495 browser_defaults::enable_help_app = false;
497 496
498 // Chrome disallows cookies by default. All code paths that want to use 497 // Chrome disallows cookies by default. All code paths that want to use
499 // cookies need to go through one of Chrome's URLRequestContexts which have 498 // cookies need to go through one of Chrome's URLRequestContexts which have
500 // a ChromeNetworkDelegate attached that selectively allows cookies again. 499 // a ChromeNetworkDelegate attached that selectively allows cookies again.
501 if (!disable_enforcing_cookie_policies_for_tests_) 500 if (!disable_enforcing_cookie_policies_for_tests_)
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 // Getting the user data dir can fail if the directory isn't 681 // Getting the user data dir can fail if the directory isn't
683 // creatable, for example; on Windows in code below we bring up a 682 // creatable, for example; on Windows in code below we bring up a
684 // dialog prompting the user to pick a different directory. 683 // dialog prompting the user to pick a different directory.
685 // However, ProcessSingleton needs a real user_data_dir on Mac/Linux, 684 // However, ProcessSingleton needs a real user_data_dir on Mac/Linux,
686 // so it's better to fail here than fail mysteriously elsewhere. 685 // so it's better to fail here than fail mysteriously elsewhere.
687 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_)) 686 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_))
688 << "Must be able to get user data directory!"; 687 << "Must be able to get user data directory!";
689 #endif 688 #endif
690 689
691 // Android's first run is done in Java instead of native. 690 // Android's first run is done in Java instead of native.
691 bool is_first_run = false;
692 #if !defined(OS_ANDROID) 692 #if !defined(OS_ANDROID)
693 process_singleton_.reset(new ProcessSingleton(user_data_dir_)); 693 process_singleton_.reset(new ProcessSingleton(user_data_dir_));
694 // Ensure ProcessSingleton won't process messages too early. It will be 694 // Ensure ProcessSingleton won't process messages too early. It will be
695 // unlocked in PostBrowserStart(). 695 // unlocked in PostBrowserStart().
696 process_singleton_->Lock(NULL); 696 process_singleton_->Lock(NULL);
697 697
698 is_first_run_ = 698 is_first_run =
699 (first_run::IsChromeFirstRun() || 699 (first_run::IsChromeFirstRun() ||
700 parsed_command_line().HasSwitch(switches::kFirstRun)) && 700 parsed_command_line().HasSwitch(switches::kFirstRun)) &&
701 !HasImportSwitch(parsed_command_line()); 701 !HasImportSwitch(parsed_command_line());
702 #endif 702 #endif
703 703
704 FilePath local_state_path; 704 FilePath local_state_path;
705 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); 705 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path));
706 scoped_refptr<base::SequencedTaskRunner> local_state_task_runner = 706 scoped_refptr<base::SequencedTaskRunner> local_state_task_runner =
707 JsonPrefStore::GetTaskRunnerForFile(local_state_path, 707 JsonPrefStore::GetTaskRunnerForFile(local_state_path,
708 BrowserThread::GetBlockingPool()); 708 BrowserThread::GetBlockingPool());
(...skipping 15 matching lines...) Expand all
724 } 724 }
725 725
726 if (parsed_command_line().HasSwitch(switches::kProfilingOutputFile)) { 726 if (parsed_command_line().HasSwitch(switches::kProfilingOutputFile)) {
727 tracking_objects_.set_output_file_path( 727 tracking_objects_.set_output_file_path(
728 parsed_command_line().GetSwitchValuePath( 728 parsed_command_line().GetSwitchValuePath(
729 switches::kProfilingOutputFile)); 729 switches::kProfilingOutputFile));
730 } 730 }
731 731
732 local_state_ = InitializeLocalState(local_state_task_runner, 732 local_state_ = InitializeLocalState(local_state_task_runner,
733 parsed_command_line(), 733 parsed_command_line(),
734 is_first_run_); 734 is_first_run);
735 735
736 // These members must be initialized before returning from this function. 736 // These members must be initialized before returning from this function.
737 master_prefs_.reset(new first_run::MasterPrefs); 737 master_prefs_.reset(new first_run::MasterPrefs);
738 738
739 #if !defined(OS_ANDROID) 739 #if !defined(OS_ANDROID)
740 // Android doesn't use StartupBrowserCreator. 740 // Android doesn't use StartupBrowserCreator.
741 browser_creator_.reset(new StartupBrowserCreator); 741 browser_creator_.reset(new StartupBrowserCreator);
742 // TODO(yfriedman): Refactor Android to re-use UMABrowsingActivityObserver 742 // TODO(yfriedman): Refactor Android to re-use UMABrowsingActivityObserver
743 chrome::UMABrowsingActivityObserver::Init(); 743 chrome::UMABrowsingActivityObserver::Init();
744 #endif 744 #endif
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 790
791 #if defined(TOOLKIT_GTK) 791 #if defined(TOOLKIT_GTK)
792 g_set_application_name(l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str()); 792 g_set_application_name(l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str());
793 #endif 793 #endif
794 794
795 // Android does first run in Java instead of native. 795 // Android does first run in Java instead of native.
796 #if !defined(OS_ANDROID) 796 #if !defined(OS_ANDROID)
797 // On first run, we need to process the predictor preferences before the 797 // On first run, we need to process the predictor preferences before the
798 // browser's profile_manager object is created, but after ResourceBundle 798 // browser's profile_manager object is created, but after ResourceBundle
799 // is initialized. 799 // is initialized.
800 first_run_ui_bypass_ = false; // True to skip first run UI. 800 // True to do first run tasks. This should be prefered to is_first_run
801 if (is_first_run_) { 801 // unless the desire is actually to know whether this is really first run
802 // (i.e. even if --no-first-run is passed).
803 do_first_run_tasks_ = false;
Nico 2012/12/21 21:44:22 Oh, I see. From the name alone I would've guessed
gab 2012/12/21 22:10:35 Ack.
804 if (is_first_run) {
802 first_run::ProcessMasterPreferencesResult pmp_result = 805 first_run::ProcessMasterPreferencesResult pmp_result =
803 first_run::ProcessMasterPreferences(user_data_dir_, 806 first_run::ProcessMasterPreferences(user_data_dir_,
804 master_prefs_.get()); 807 master_prefs_.get());
805 if (pmp_result == first_run::EULA_EXIT_NOW) 808 if (pmp_result == first_run::EULA_EXIT_NOW)
806 return chrome::RESULT_CODE_EULA_REFUSED; 809 return chrome::RESULT_CODE_EULA_REFUSED;
807 810
808 first_run_ui_bypass_ = (pmp_result == first_run::SKIP_FIRST_RUN); 811 do_first_run_tasks_ = (pmp_result != first_run::SKIP_FIRST_RUN_TASKS);
809 812
810 AddFirstRunNewTabs(browser_creator_.get(), master_prefs_->new_tabs); 813 AddFirstRunNewTabs(browser_creator_.get(), master_prefs_->new_tabs);
811 814
812 // If we are running in App mode, we do not want to show the importer 815 // If we are running in App mode, we do not want to show the importer
813 // (first run) UI. 816 // (first run) UI.
814 if (!first_run_ui_bypass_ && 817 if (do_first_run_tasks_ &&
Nico 2012/12/21 21:44:22 Pointless check. HasSwitch() is fast, remove htis.
gab 2012/12/21 22:10:35 Done.
815 (parsed_command_line().HasSwitch(switches::kApp) || 818 (parsed_command_line().HasSwitch(switches::kApp) ||
816 parsed_command_line().HasSwitch(switches::kAppId) || 819 parsed_command_line().HasSwitch(switches::kAppId))) {
817 parsed_command_line().HasSwitch(switches::kNoFirstRun))) 820 do_first_run_tasks_ = false;
818 first_run_ui_bypass_ = true; 821 }
819 822
820 // Create Sentinel if no-first-run argument is passed in. 823 // Create Sentinel if no-first-run argument is passed in.
821 if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) 824 if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) {
825 do_first_run_tasks_ = false;
822 first_run::CreateSentinel(); 826 first_run::CreateSentinel();
827 }
823 } 828 }
824 #endif 829 #endif
825 830
826 // TODO(viettrungluu): why don't we run this earlier? 831 // TODO(viettrungluu): why don't we run this earlier?
827 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) 832 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs))
828 WarnAboutMinimumSystemRequirements(); 833 WarnAboutMinimumSystemRequirements();
829 834
830 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) 835 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX)
831 // Set the product channel for crash reports. 836 // Set the product channel for crash reports.
832 child_process_logging::SetChannel( 837 child_process_logging::SetChannel(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 chrome_extra_parts_[i]->PreMainMessageLoopRun(); 879 chrome_extra_parts_[i]->PreMainMessageLoopRun();
875 } 880 }
876 881
877 // PreMainMessageLoopRun calls these extra stages in the following order: 882 // PreMainMessageLoopRun calls these extra stages in the following order:
878 // PreMainMessageLoopRunImpl() 883 // PreMainMessageLoopRunImpl()
879 // ... initial setup, including browser_process_ setup. 884 // ... initial setup, including browser_process_ setup.
880 // PreProfileInit() 885 // PreProfileInit()
881 // ... additional setup, including CreateProfile() 886 // ... additional setup, including CreateProfile()
882 // PostProfileInit() 887 // PostProfileInit()
883 // ... additional setup 888 // ... additional setup
884 // PreInteractiveFirstRunInit()
885 // ... first_run::AutoImport()
886 // PostInteractiveFirstRunInit()
887 // ... additional setup
888 // PreBrowserStart() 889 // PreBrowserStart()
889 // ... browser_creator_->Start (OR parameters().ui_task->Run()) 890 // ... browser_creator_->Start (OR parameters().ui_task->Run())
890 // PostBrowserStart() 891 // PostBrowserStart()
891 892
892 void ChromeBrowserMainParts::PreProfileInit() { 893 void ChromeBrowserMainParts::PreProfileInit() {
893 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 894 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
894 chrome_extra_parts_[i]->PreProfileInit(); 895 chrome_extra_parts_[i]->PreProfileInit();
895 } 896 }
896 897
897 void ChromeBrowserMainParts::PostProfileInit() { 898 void ChromeBrowserMainParts::PostProfileInit() {
898 LaunchDevToolsHandlerIfNeeded(profile(), parsed_command_line()); 899 LaunchDevToolsHandlerIfNeeded(profile(), parsed_command_line());
899 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 900 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
900 chrome_extra_parts_[i]->PostProfileInit(); 901 chrome_extra_parts_[i]->PostProfileInit();
901 } 902 }
902 903
903 void ChromeBrowserMainParts::PreInteractiveFirstRunInit() {
904 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
905 chrome_extra_parts_[i]->PreInteractiveFirstRunInit();
906 }
907
908 void ChromeBrowserMainParts::PostInteractiveFirstRunInit() {
909 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
910 chrome_extra_parts_[i]->PostInteractiveFirstRunInit();
911 }
912
913 void ChromeBrowserMainParts::PreBrowserStart() { 904 void ChromeBrowserMainParts::PreBrowserStart() {
914 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 905 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
915 chrome_extra_parts_[i]->PreBrowserStart(); 906 chrome_extra_parts_[i]->PreBrowserStart();
916 #if !defined(OS_ANDROID) 907 #if !defined(OS_ANDROID)
917 gpu_util::InstallBrowserMonitor(); 908 gpu_util::InstallBrowserMonitor();
918 #endif 909 #endif
919 } 910 }
920 911
921 void ChromeBrowserMainParts::PostBrowserStart() { 912 void ChromeBrowserMainParts::PostBrowserStart() {
922 #if !defined(OS_ANDROID) 913 #if !defined(OS_ANDROID)
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 ShellIntegration::SetAsDefaultBrowser(); 1103 ShellIntegration::SetAsDefaultBrowser();
1113 } 1104 }
1114 #else 1105 #else
1115 // We don't support retention experiments on Mac or Linux. 1106 // We don't support retention experiments on Mac or Linux.
1116 return content::RESULT_CODE_NORMAL_EXIT; 1107 return content::RESULT_CODE_NORMAL_EXIT;
1117 #endif // defined(OS_WIN) 1108 #endif // defined(OS_WIN)
1118 } 1109 }
1119 1110
1120 // Profile creation ---------------------------------------------------------- 1111 // Profile creation ----------------------------------------------------------
1121 1112
1122 if (is_first_run_) { 1113 if (do_first_run_tasks_) {
1123 // Warn the ProfileManager that an import process will run, possibly 1114 // Warn the ProfileManager that an import process will run, possibly
1124 // locking the WebDataService directory of the next Profile created. 1115 // locking the WebDataService directory of the next Profile created.
1125 browser_process_->profile_manager()->SetWillImport(); 1116 browser_process_->profile_manager()->SetWillImport();
1126 } 1117 }
1127 1118
1128 profile_ = CreateProfile(parameters(), user_data_dir_, parsed_command_line()); 1119 profile_ = CreateProfile(parameters(), user_data_dir_, parsed_command_line());
1129 if (!profile_) 1120 if (!profile_)
1130 return content::RESULT_CODE_NORMAL_EXIT; 1121 return content::RESULT_CODE_NORMAL_EXIT;
1131 1122
1132 #if defined(ENABLE_BACKGROUND) 1123 #if defined(ENABLE_BACKGROUND)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 // blacklist decisions. 1173 // blacklist decisions.
1183 if (g_browser_process->gl_string_manager()) 1174 if (g_browser_process->gl_string_manager())
1184 g_browser_process->gl_string_manager()->Initialize(); 1175 g_browser_process->gl_string_manager()->Initialize();
1185 1176
1186 #if !defined(OS_ANDROID) 1177 #if !defined(OS_ANDROID)
1187 // Show the First Run UI if this is the first time Chrome has been run on 1178 // Show the First Run UI if this is the first time Chrome has been run on
1188 // this computer, or we're being compelled to do so by a command line flag. 1179 // this computer, or we're being compelled to do so by a command line flag.
1189 // Note that this be done _after_ the PrefService is initialized and all 1180 // Note that this be done _after_ the PrefService is initialized and all
1190 // preferences are registered, since some of the code that the importer 1181 // preferences are registered, since some of the code that the importer
1191 // touches reads preferences. 1182 // touches reads preferences.
1192 if (is_first_run_) { 1183 if (do_first_run_tasks_) {
1193 PreInteractiveFirstRunInit(); 1184 first_run::AutoImport(profile_,
1194 1185 master_prefs_->homepage_defined,
1195 if (!first_run_ui_bypass_) { 1186 master_prefs_->do_import_items,
1196 first_run::AutoImport(profile_, 1187 master_prefs_->dont_import_items,
1197 master_prefs_->homepage_defined, 1188 process_singleton_.get());
1198 master_prefs_->do_import_items, 1189 first_run::DoPostImportTasks(profile_, master_prefs_->make_chrome_default);
1199 master_prefs_->dont_import_items,
1200 process_singleton_.get());
1201 first_run::DoFirstRunTasks(profile_, master_prefs_->make_chrome_default);
1202 #if defined(OS_POSIX) && !defined(OS_CHROMEOS)
1203 // TODO(thakis): Look into moving this POSIX-specific section to
1204 // ChromeBrowserMainPartsPosix::PostInteractiveFirstRunInit().
1205
1206 // On Windows, the download is tagged with enable/disable stats so there
1207 // is no need for this code.
1208
1209 // If stats reporting was turned on by the first run dialog then toggle
1210 // the pref.
1211 if (GoogleUpdateSettings::GetCollectStatsConsent())
1212 local_state_->SetBoolean(prefs::kMetricsReportingEnabled, true);
1213 #endif // OS_POSIX && !OS_CHROMEOS
1214 } // if (!first_run_ui_bypass_)
1215 PostInteractiveFirstRunInit();
1216 1190
1217 browser_process_->profile_manager()->OnImportFinished(profile_); 1191 browser_process_->profile_manager()->OnImportFinished(profile_);
1218 1192
1219 if (!master_prefs_->suppress_first_run_default_browser_prompt) { 1193 if (!master_prefs_->suppress_first_run_default_browser_prompt) {
1220 browser_creator_->set_show_main_browser_window( 1194 browser_creator_->set_show_main_browser_window(
1221 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); 1195 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_));
1222 } else { 1196 } else {
1223 browser_creator_->set_is_default_browser_dialog_suppressed(true); 1197 browser_creator_->set_is_default_browser_dialog_suppressed(true);
1224 } 1198 }
1225 } // if (is_first_run_) 1199 } // if (do_first_run_tasks_)
1226 #endif // !defined(OS_ANDROID) 1200 #endif // !defined(OS_ANDROID)
1227 1201
1228 #if defined(OS_WIN) 1202 #if defined(OS_WIN)
1229 // Sets things up so that if we crash from this point on, a dialog will 1203 // Sets things up so that if we crash from this point on, a dialog will
1230 // popup asking the user to restart chrome. It is done this late to avoid 1204 // popup asking the user to restart chrome. It is done this late to avoid
1231 // testing against a bunch of special cases that are taken care early on. 1205 // testing against a bunch of special cases that are taken care early on.
1232 ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( 1206 ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment(
1233 parsed_command_line()); 1207 parsed_command_line());
1234 1208
1235 // Registers Chrome with the Windows Restart Manager, which will restore the 1209 // Registers Chrome with the Windows Restart Manager, which will restore the
(...skipping 13 matching lines...) Expand all
1249 base::Bind(&NetworkProfileBubble::CheckNetworkProfile, 1223 base::Bind(&NetworkProfileBubble::CheckNetworkProfile,
1250 profile_->GetPath())); 1224 profile_->GetPath()));
1251 } 1225 }
1252 #endif // OS_WIN 1226 #endif // OS_WIN
1253 1227
1254 #if defined(ENABLE_RLZ) && !defined(OS_CHROMEOS) 1228 #if defined(ENABLE_RLZ) && !defined(OS_CHROMEOS)
1255 // Init the RLZ library. This just binds the dll and schedules a task on the 1229 // Init the RLZ library. This just binds the dll and schedules a task on the
1256 // file thread to be run sometime later. If this is the first run we record 1230 // file thread to be run sometime later. If this is the first run we record
1257 // the installation event. 1231 // the installation event.
1258 PrefService* pref_service = profile_->GetPrefs(); 1232 PrefService* pref_service = profile_->GetPrefs();
1259 int ping_delay = is_first_run_ ? master_prefs_->ping_delay : 1233 int ping_delay = do_first_run_tasks_ ? master_prefs_->ping_delay :
1260 pref_service->GetInteger(first_run::GetPingDelayPrefName().c_str()); 1234 pref_service->GetInteger(first_run::GetPingDelayPrefName().c_str());
1261 RLZTracker::InitRlzFromProfileDelayed(profile_, is_first_run_, ping_delay); 1235 RLZTracker::InitRlzFromProfileDelayed(profile_, do_first_run_tasks_,
1236 ping_delay);
1262 #endif // defined(ENABLE_RLZ) && !defined(OS_CHROMEOS) 1237 #endif // defined(ENABLE_RLZ) && !defined(OS_CHROMEOS)
1263 1238
1264 // Configure modules that need access to resources. 1239 // Configure modules that need access to resources.
1265 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); 1240 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider);
1266 1241
1267 // In unittest mode, this will do nothing. In normal mode, this will create 1242 // In unittest mode, this will do nothing. In normal mode, this will create
1268 // the global IntranetRedirectDetector instance, which will promptly go to 1243 // the global IntranetRedirectDetector instance, which will promptly go to
1269 // sleep for seven seconds (to avoid slowing startup), and wake up afterwards 1244 // sleep for seven seconds (to avoid slowing startup), and wake up afterwards
1270 // to see if it should do anything else. 1245 // to see if it should do anything else.
1271 // 1246 //
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 // ThreadWatcher takes over or when browser is shutdown or when 1322 // ThreadWatcher takes over or when browser is shutdown or when
1348 // startup_watcher_ is deleted. 1323 // startup_watcher_ is deleted.
1349 startup_watcher_->Arm(base::TimeDelta::FromSeconds(300)); 1324 startup_watcher_->Arm(base::TimeDelta::FromSeconds(300));
1350 1325
1351 // Start watching for a hang. 1326 // Start watching for a hang.
1352 MetricsService::LogNeedForCleanShutdown(); 1327 MetricsService::LogNeedForCleanShutdown();
1353 1328
1354 #if defined(OS_WIN) 1329 #if defined(OS_WIN)
1355 // We check this here because if the profile is OTR (chromeos possibility) 1330 // We check this here because if the profile is OTR (chromeos possibility)
1356 // it won't still be accessible after browser is destroyed. 1331 // it won't still be accessible after browser is destroyed.
1357 record_search_engine_ = is_first_run_ && !profile_->IsOffTheRecord(); 1332 record_search_engine_ = do_first_run_tasks_ && !profile_->IsOffTheRecord();
1358 #endif 1333 #endif
1359 1334
1360 // Create the instance of the cloud print proxy service so that it can launch 1335 // Create the instance of the cloud print proxy service so that it can launch
1361 // the service process if needed. This is needed because the service process 1336 // the service process if needed. This is needed because the service process
1362 // might have shutdown because an update was available. 1337 // might have shutdown because an update was available.
1363 // TODO(torne): this should maybe be done with 1338 // TODO(torne): this should maybe be done with
1364 // ProfileKeyedServiceFactory::ServiceIsCreatedWithProfile() instead? 1339 // ProfileKeyedServiceFactory::ServiceIsCreatedWithProfile() instead?
1365 #if !defined(OS_ANDROID) 1340 #if !defined(OS_ANDROID)
1366 CloudPrintProxyServiceFactory::GetForProfile(profile_); 1341 CloudPrintProxyServiceFactory::GetForProfile(profile_);
1367 #endif 1342 #endif
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 if (base::win::GetVersion() <= base::win::VERSION_XP) 1654 if (base::win::GetVersion() <= base::win::VERSION_XP)
1680 uma_name += "_XP"; 1655 uma_name += "_XP";
1681 1656
1682 uma_name += "_PreRead_"; 1657 uma_name += "_PreRead_";
1683 uma_name += pre_read_percentage; 1658 uma_name += pre_read_percentage;
1684 AddPreReadHistogramTime(uma_name.c_str(), time); 1659 AddPreReadHistogramTime(uma_name.c_str(), time);
1685 } 1660 }
1686 #endif 1661 #endif
1687 #endif 1662 #endif
1688 } 1663 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/chrome_browser_main_extra_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698