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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 898003002: [Cleanup] Const-correct the profile() method for the EasyUnlockService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 12915c312e87a79d3507a2d24c6dd958a2f27bd5..b6bfe67b2e2fd52cb1d065c4d88107561688127b 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -754,9 +754,9 @@ ProfileImpl::~ProfileImpl() {
SetExitType(EXIT_NORMAL);
}
-std::string ProfileImpl::GetProfileUserName() {
- SigninManagerBase* signin_manager =
- SigninManagerFactory::GetForProfile(this);
+std::string ProfileImpl::GetProfileUserName() const {
+ const SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfileIfExists(this);
if (signin_manager)
return signin_manager->GetAuthenticatedUsername();
@@ -939,6 +939,11 @@ Profile::ExitType ProfileImpl::GetLastSessionExitType() {
}
PrefService* ProfileImpl::GetPrefs() {
+ return const_cast<PrefService*>(
+ static_cast<const ProfileImpl*>(this)->GetPrefs());
+}
+
+const PrefService* ProfileImpl::GetPrefs() const {
DCHECK(prefs_); // Should explicitly be initialized.
return prefs_.get();
}
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698