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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 2644663003: Offer to open the startup pages after a crash. (Closed)
Patch Set: Rebase Created 3 years, 11 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 base::Bind(&ProcessCommandLineOnProfileCreated, command_line, cur_dir), 893 base::Bind(&ProcessCommandLineOnProfileCreated, command_line, cur_dir),
894 base::string16(), std::string(), std::string()); 894 base::string16(), std::string(), std::string());
895 return; 895 return;
896 } 896 }
897 StartupBrowserCreator startup_browser_creator; 897 StartupBrowserCreator startup_browser_creator;
898 startup_browser_creator.ProcessCmdLineImpl(command_line, cur_dir, false, 898 startup_browser_creator.ProcessCmdLineImpl(command_line, cur_dir, false,
899 profile, Profiles()); 899 profile, Profiles());
900 } 900 }
901 901
902 // static 902 // static
903 void StartupBrowserCreator::OpenStartupPages(Browser* browser,
904 bool process_startup) {
905 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
906 chrome::startup::IsFirstRun is_first_run =
907 first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN
908 : chrome::startup::IS_NOT_FIRST_RUN;
909 StartupBrowserCreatorImpl startup_browser_creator_impl(
910 base::FilePath(), command_line, is_first_run);
911 SessionStartupPref session_startup_pref =
912 StartupBrowserCreator::GetSessionStartupPref(command_line,
913 browser->profile());
914 startup_browser_creator_impl.OpenURLsInBrowser(browser, process_startup,
915 session_startup_pref.urls);
916 }
917
918 // static
903 bool StartupBrowserCreator::ActivatedProfile() { 919 bool StartupBrowserCreator::ActivatedProfile() {
904 return profile_launch_observer.Get().activated_profile(); 920 return profile_launch_observer.Get().activated_profile();
905 } 921 }
906 922
907 bool HasPendingUncleanExit(Profile* profile) { 923 bool HasPendingUncleanExit(Profile* profile) {
908 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && 924 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
909 !profile_launch_observer.Get().HasBeenLaunched(profile); 925 !profile_launch_observer.Get().HasBeenLaunched(profile);
910 } 926 }
911 927
912 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, 928 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 if (!entry->IsSigninRequired()) { 1008 if (!entry->IsSigninRequired()) {
993 Profile* profile = profile_manager->GetProfile(entry->GetPath()); 1009 Profile* profile = profile_manager->GetProfile(entry->GetPath());
994 if (profile) 1010 if (profile)
995 return profile; 1011 return profile;
996 } 1012 }
997 } 1013 }
998 1014
999 return nullptr; 1015 return nullptr;
1000 } 1016 }
1001 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 1017 #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/views/session_crashed_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698