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/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "apps/app_load_service.h" | 10 #include "apps/app_load_service.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 } | 357 } |
358 if (pref.type == SessionStartupPref::LAST && | 358 if (pref.type == SessionStartupPref::LAST && |
359 IncognitoModePrefs::ShouldLaunchIncognito(command_line, prefs)) { | 359 IncognitoModePrefs::ShouldLaunchIncognito(command_line, prefs)) { |
360 // We don't store session information when incognito. If the user has | 360 // We don't store session information when incognito. If the user has |
361 // chosen to restore last session and launched incognito, fallback to | 361 // chosen to restore last session and launched incognito, fallback to |
362 // default launch behavior. | 362 // default launch behavior. |
363 pref.type = SessionStartupPref::DEFAULT; | 363 pref.type = SessionStartupPref::DEFAULT; |
364 } | 364 } |
365 | 365 |
366 #if defined(OS_CHROMEOS) | 366 #if defined(OS_CHROMEOS) |
367 // Kiosk/Retail mode has no profile to restore and fails to open the tabs | 367 // Kiosk/Retail mode receives startup URLs through device settings. They are |
368 // specified in the startup_urls policy if we try to restore the non-existent | 368 // appended to the command line, which requires type DEFAULT to work. |
369 // session which is the default for ChromeOS in general. | 369 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) |
370 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) { | |
371 DCHECK(pref.type == SessionStartupPref::LAST); | |
372 pref.type = SessionStartupPref::DEFAULT; | 370 pref.type = SessionStartupPref::DEFAULT; |
sky
2013/09/27 17:01:15
Why is it a problem to restore the last session he
Mattias Nissler (ping if slow)
2013/09/27 17:07:30
I don't know TBH. Julian, can you please comment?
pastarmovj
2013/09/30 08:53:33
When the new smarter session restore was implement
marja
2013/09/30 11:30:06
Hmm.
1) If your startup pref is "last", and you p
Mattias Nissler (ping if slow)
2013/09/30 12:03:58
FWIW, I didn't change any code, just trying to get
| |
373 } | |
374 #endif // OS_CHROMEOS | 371 #endif // OS_CHROMEOS |
375 | 372 |
376 return pref; | 373 return pref; |
377 } | 374 } |
378 | 375 |
379 // static | 376 // static |
380 void StartupBrowserCreator::ClearLaunchedProfilesForTesting() { | 377 void StartupBrowserCreator::ClearLaunchedProfilesForTesting() { |
381 profile_launch_observer.Get().Clear(); | 378 profile_launch_observer.Get().Clear(); |
382 } | 379 } |
383 | 380 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
745 | 742 |
746 // static | 743 // static |
747 bool StartupBrowserCreator::ActivatedProfile() { | 744 bool StartupBrowserCreator::ActivatedProfile() { |
748 return profile_launch_observer.Get().activated_profile(); | 745 return profile_launch_observer.Get().activated_profile(); |
749 } | 746 } |
750 | 747 |
751 bool HasPendingUncleanExit(Profile* profile) { | 748 bool HasPendingUncleanExit(Profile* profile) { |
752 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && | 749 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && |
753 !profile_launch_observer.Get().HasBeenLaunched(profile); | 750 !profile_launch_observer.Get().HasBeenLaunched(profile); |
754 } | 751 } |
OLD | NEW |