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

Side by Side 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: 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 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 } 932 }
933 933
934 Profile::ExitType ProfileImpl::GetLastSessionExitType() { 934 Profile::ExitType ProfileImpl::GetLastSessionExitType() {
935 // last_session_exited_cleanly_ is set when the preferences are loaded. Force 935 // last_session_exited_cleanly_ is set when the preferences are loaded. Force
936 // it to be set by asking for the prefs. 936 // it to be set by asking for the prefs.
937 GetPrefs(); 937 GetPrefs();
938 return last_session_exit_type_; 938 return last_session_exit_type_;
939 } 939 }
940 940
941 PrefService* ProfileImpl::GetPrefs() { 941 PrefService* ProfileImpl::GetPrefs() {
942 return const_cast<PrefService*>(
943 static_cast<const ProfileImpl*>(this)->GetPrefs());
944 }
945
946 const PrefService* ProfileImpl::GetPrefs() const {
942 DCHECK(prefs_); // Should explicitly be initialized. 947 DCHECK(prefs_); // Should explicitly be initialized.
943 return prefs_.get(); 948 return prefs_.get();
944 } 949 }
945 950
946 chrome::ChromeZoomLevelPrefs* ProfileImpl::GetZoomLevelPrefs() { 951 chrome::ChromeZoomLevelPrefs* ProfileImpl::GetZoomLevelPrefs() {
947 return static_cast<chrome::ChromeZoomLevelPrefs*>( 952 return static_cast<chrome::ChromeZoomLevelPrefs*>(
948 GetDefaultStoragePartition(this)->GetZoomLevelDelegate()); 953 GetDefaultStoragePartition(this)->GetZoomLevelDelegate());
949 } 954 }
950 955
951 PrefService* ProfileImpl::GetOffTheRecordPrefs() { 956 PrefService* ProfileImpl::GetOffTheRecordPrefs() {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1328 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1324 domain_reliability::DomainReliabilityService* service = 1329 domain_reliability::DomainReliabilityService* service =
1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1330 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1326 GetForBrowserContext(this); 1331 GetForBrowserContext(this);
1327 if (!service) 1332 if (!service)
1328 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1333 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1329 1334
1330 return service->CreateMonitor( 1335 return service->CreateMonitor(
1331 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1336 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1332 } 1337 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698