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

Side by Side Diff: chrome/browser/profiles/profile.cc

Issue 847733005: Move User Manager onto a System profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 20 matching lines...) Expand all
31 #endif 31 #endif
32 32
33 #if defined(ENABLE_EXTENSIONS) 33 #if defined(ENABLE_EXTENSIONS)
34 #include "extensions/browser/pref_names.h" 34 #include "extensions/browser/pref_names.h"
35 #endif 35 #endif
36 36
37 Profile::Profile() 37 Profile::Profile()
38 : restored_last_session_(false), 38 : restored_last_session_(false),
39 sent_destroyed_notification_(false), 39 sent_destroyed_notification_(false),
40 accessibility_pause_level_(0), 40 accessibility_pause_level_(0),
41 is_guest_profile_(false) { 41 is_guest_profile_(false),
42 is_system_profile_(false) {
42 } 43 }
43 44
44 Profile::~Profile() { 45 Profile::~Profile() {
45 } 46 }
46 47
47 // static 48 // static
48 Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) { 49 Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) {
49 // This is safe; this is the only implementation of the browser context. 50 // This is safe; this is the only implementation of the browser context.
50 return static_cast<Profile*>(browser_context); 51 return static_cast<Profile*>(browser_context);
51 } 52 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 #if defined(OS_CHROMEOS) 209 #if defined(OS_CHROMEOS)
209 static bool is_guest_session = 210 static bool is_guest_session =
210 base::CommandLine::ForCurrentProcess()->HasSwitch( 211 base::CommandLine::ForCurrentProcess()->HasSwitch(
211 chromeos::switches::kGuestSession); 212 chromeos::switches::kGuestSession);
212 return is_guest_session; 213 return is_guest_session;
213 #else 214 #else
214 return is_guest_profile_; 215 return is_guest_profile_;
215 #endif 216 #endif
216 } 217 }
217 218
219 bool Profile::IsSystemProfile() const {
220 return is_system_profile_;
221 }
222
218 bool Profile::IsNewProfile() { 223 bool Profile::IsNewProfile() {
219 // The profile has been shut down if the prefs were loaded from disk, unless 224 // The profile has been shut down if the prefs were loaded from disk, unless
220 // first-run autoimport wrote them and reloaded the pref service. 225 // first-run autoimport wrote them and reloaded the pref service.
221 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile 226 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile
222 // import code) is fixed. 227 // import code) is fixed.
223 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() == 228 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() ==
224 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; 229 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE;
225 } 230 }
226 231
227 bool Profile::IsSyncAccessible() { 232 bool Profile::IsSyncAccessible() {
(...skipping 23 matching lines...) Expand all
251 if (a->IsSameProfile(b)) 256 if (a->IsSameProfile(b))
252 return false; 257 return false;
253 return a->GetOriginalProfile() < b->GetOriginalProfile(); 258 return a->GetOriginalProfile() < b->GetOriginalProfile();
254 } 259 }
255 260
256 double Profile::GetDefaultZoomLevelForProfile() { 261 double Profile::GetDefaultZoomLevelForProfile() {
257 return GetDefaultStoragePartition(this) 262 return GetDefaultStoragePartition(this)
258 ->GetHostZoomMap() 263 ->GetHostZoomMap()
259 ->GetDefaultZoomLevel(); 264 ->GetDefaultZoomLevel();
260 } 265 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698