summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 02:26:36 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 02:26:36 +0000
commit2ca1ea66c938dd34c25e3cafe9cdfc46cdd50881 (patch)
treed1f83644dd7f5c4e59304c5286f509eb1d8c46cb /chrome/browser/profiles
parentb68232832acde42bf3835dae286870c57ba1c6f7 (diff)
downloadchromium_src-2ca1ea66c938dd34c25e3cafe9cdfc46cdd50881.zip
chromium_src-2ca1ea66c938dd34c25e3cafe9cdfc46cdd50881.tar.gz
chromium_src-2ca1ea66c938dd34c25e3cafe9cdfc46cdd50881.tar.bz2
Removes BrowserContext::DidLastSessionExitCleanly() and makes
NavigationController::Restore() take an enum instead that encapsculates this. BUG=90737 TEST=none R=avi@chromium.org,sail@chromium.org Review URL: https://chromiumcodereview.appspot.com/11016038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profiles')
-rw-r--r--chrome/browser/profiles/off_the_record_profile_impl.cc8
-rw-r--r--chrome/browser/profiles/off_the_record_profile_impl.h2
-rw-r--r--chrome/browser/profiles/profile.h3
-rw-r--r--chrome/browser/profiles/profile_impl.cc14
-rw-r--r--chrome/browser/profiles/profile_impl.h2
5 files changed, 16 insertions, 13 deletions
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index ddb5623..33e3b6f 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -335,10 +335,6 @@ content::SpeechRecognitionPreferences*
return profile_->GetSpeechRecognitionPreferences();
}
-bool OffTheRecordProfileImpl::DidLastSessionExitCleanly() {
- return profile_->DidLastSessionExitCleanly();
-}
-
quota::SpecialStoragePolicy*
OffTheRecordProfileImpl::GetSpecialStoragePolicy() {
return GetExtensionSpecialStoragePolicy();
@@ -389,6 +385,10 @@ bool OffTheRecordProfileImpl::WasCreatedByVersionOrLater(
return profile_->WasCreatedByVersionOrLater(version);
}
+bool OffTheRecordProfileImpl::DidLastSessionExitCleanly() {
+ return profile_->DidLastSessionExitCleanly();
+}
+
#if defined(OS_CHROMEOS)
void OffTheRecordProfileImpl::SetupChromeOSEnterpriseExtensionObserver() {
profile_->SetupChromeOSEnterpriseExtensionObserver();
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.h b/chrome/browser/profiles/off_the_record_profile_impl.h
index be2278c..edcac8d 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.h
+++ b/chrome/browser/profiles/off_the_record_profile_impl.h
@@ -66,6 +66,7 @@ class OffTheRecordProfileImpl : public Profile,
virtual FilePath last_selected_directory() OVERRIDE;
virtual void set_last_selected_directory(const FilePath& path) OVERRIDE;
virtual bool WasCreatedByVersionOrLater(const std::string& version) OVERRIDE;
+ virtual bool DidLastSessionExitCleanly() OVERRIDE;
#if defined(OS_CHROMEOS)
virtual void SetupChromeOSEnterpriseExtensionObserver() OVERRIDE;
@@ -101,7 +102,6 @@ class OffTheRecordProfileImpl : public Profile,
GetGeolocationPermissionContext() OVERRIDE;
virtual content::SpeechRecognitionPreferences*
GetSpeechRecognitionPreferences() OVERRIDE;
- virtual bool DidLastSessionExitCleanly() OVERRIDE;
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
// content::NotificationObserver implementation.
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h
index 3e3688d..2d8f8f3 100644
--- a/chrome/browser/profiles/profile.h
+++ b/chrome/browser/profiles/profile.h
@@ -339,6 +339,9 @@ 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;
+
// Stop sending accessibility events until ResumeAccessibilityEvents().
// Calls to Pause nest; no events will be sent until the number of
// Resume calls matches the number of Pause calls received.
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 8b0bfa4..7ef0012 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -637,6 +637,13 @@ bool ProfileImpl::WasCreatedByVersionOrLater(const std::string& version) {
return (profile_version.CompareTo(arg_version) >= 0);
}
+bool ProfileImpl::DidLastSessionExitCleanly() {
+ // last_session_exited_cleanly_ is set when the preferences are loaded. Force
+ // it to be set by asking for the prefs.
+ GetPrefs();
+ return last_session_exited_cleanly_;
+}
+
policy::UserCloudPolicyManager* ProfileImpl::GetUserCloudPolicyManager() {
return cloud_policy_manager_.get();
}
@@ -791,13 +798,6 @@ DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() {
GetDownloadManagerDelegate();
}
-bool ProfileImpl::DidLastSessionExitCleanly() {
- // last_session_exited_cleanly_ is set when the preferences are loaded. Force
- // it to be set by asking for the prefs.
- GetPrefs();
- return last_session_exited_cleanly_;
-}
-
quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() {
return GetExtensionSpecialStoragePolicy();
}
diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h
index b714d39..53a9830f 100644
--- a/chrome/browser/profiles/profile_impl.h
+++ b/chrome/browser/profiles/profile_impl.h
@@ -70,7 +70,6 @@ class ProfileImpl : public Profile,
GetGeolocationPermissionContext() OVERRIDE;
virtual content::SpeechRecognitionPreferences*
GetSpeechRecognitionPreferences() OVERRIDE;
- virtual bool DidLastSessionExitCleanly() OVERRIDE;
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
// Profile implementation:
@@ -109,6 +108,7 @@ class ProfileImpl : public Profile,
virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE;
virtual GURL GetHomePage() OVERRIDE;
virtual bool WasCreatedByVersionOrLater(const std::string& version) OVERRIDE;
+ virtual bool DidLastSessionExitCleanly() OVERRIDE;
#if defined(OS_CHROMEOS)
virtual void ChangeAppLocale(const std::string& locale,