summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles/profile.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-05 16:27:22 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-05 16:27:22 +0000
commit6c0ca7fc3a07040aee3106f86650ef6cdbf3327a (patch)
treee8564c51f7d778e3847615c6b85b087008840e17 /chrome/browser/profiles/profile.h
parent2f11e0172cf0eab47f481dce887f8a92e3e40b29 (diff)
downloadchromium_src-6c0ca7fc3a07040aee3106f86650ef6cdbf3327a.zip
chromium_src-6c0ca7fc3a07040aee3106f86650ef6cdbf3327a.tar.gz
chromium_src-6c0ca7fc3a07040aee3106f86650ef6cdbf3327a.tar.bz2
Changes pref for whether last session exited cleanly from a boolean to
a string pref that enumerates the ways the session ended: normal, result of logout/shutdown, crashed. I need this for knowing when TabRestoreService should restore from the previous session. BUG=150799 TEST=none, this is prep for real fix R=sail@chromium.org Review URL: https://chromiumcodereview.appspot.com/11039041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profiles/profile.h')
-rw-r--r--chrome/browser/profiles/profile.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h
index 2d8f8f3..88dce13 100644
--- a/chrome/browser/profiles/profile.h
+++ b/chrome/browser/profiles/profile.h
@@ -117,6 +117,17 @@ class Profile : public content::BrowserContext {
CREATE_MODE_ASYNCHRONOUS
};
+ enum ExitType {
+ // A normal shutdown. The user clicked exit/closed last window of the
+ // profile.
+ EXIT_NORMAL,
+
+ // The exit was the result of the system shutting down.
+ EXIT_SESSION_ENDED,
+
+ EXIT_CRASHED,
+ };
+
class Delegate {
public:
// Called when creation of the profile is finished.
@@ -267,12 +278,6 @@ class Profile : public content::BrowserContext {
// the user started chrome.
virtual base::Time GetStartTime() const = 0;
- // Marks the profile as cleanly shutdown.
- //
- // NOTE: this is invoked internally on a normal shutdown, but is public so
- // that it can be invoked when the user logs out/powers down (WM_ENDSESSION).
- virtual void MarkAsCleanShutdown() = 0;
-
// Start up service that gathers data from a promo resource feed.
virtual void InitPromoResources() = 0;
@@ -339,8 +344,17 @@ class Profile : public content::BrowserContext {
return restored_last_session_;
}
- // Returns true if the last time this profile was open it was exited cleanly.
- virtual bool DidLastSessionExitCleanly() = 0;
+ // Sets the ExitType for the profile. This may be invoked multiple times
+ // during shutdown; the value of the first invocation is written to prefs, any
+ // other calls are ignored. Only legal values to pass to this are
+ // EXIT_SESSION_ENDED and EXIT_NORMAL.
+ //
+ // NOTE: this is invoked internally on a normal shutdown, but is public so
+ // that it can be invoked when the user logs out/powers down (WM_ENDSESSION).
+ virtual void SetExitType(ExitType exit_type) = 0;
+
+ // Returns how the last session was shutdown.
+ virtual ExitType GetLastSessionExitType() = 0;
// Stop sending accessibility events until ResumeAccessibilityEvents().
// Calls to Pause nest; no events will be sent until the number of