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

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

Issue 2616423002: Added IsPublicSession utility function to profiles_state (Closed)
Patch Set: Moved to profiles_state Created 3 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/profiles_state.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/profiles_state.h" 5 #include "chrome/browser/profiles/profiles_state.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 16 matching lines...) Expand all
27 #include "chrome/grit/generated_resources.h" 27 #include "chrome/grit/generated_resources.h"
28 #include "components/prefs/pref_registry_simple.h" 28 #include "components/prefs/pref_registry_simple.h"
29 #include "components/prefs/pref_service.h" 29 #include "components/prefs/pref_service.h"
30 #include "components/signin/core/browser/profile_oauth2_token_service.h" 30 #include "components/signin/core/browser/profile_oauth2_token_service.h"
31 #include "components/signin/core/common/profile_management_switches.h" 31 #include "components/signin/core/common/profile_management_switches.h"
32 #include "components/signin/core/common/signin_pref_names.h" 32 #include "components/signin/core/common/signin_pref_names.h"
33 #include "content/public/browser/resource_dispatcher_host.h" 33 #include "content/public/browser/resource_dispatcher_host.h"
34 #include "ui/base/l10n/l10n_util.h" 34 #include "ui/base/l10n/l10n_util.h"
35 #include "ui/gfx/text_elider.h" 35 #include "ui/gfx/text_elider.h"
36 36
37 #if defined(OS_CHROMEOS)
38 #include "chromeos/login/login_state.h"
39 #endif
40
37 namespace profiles { 41 namespace profiles {
38 42
39 bool IsMultipleProfilesEnabled() { 43 bool IsMultipleProfilesEnabled() {
40 #if defined(OS_ANDROID) 44 #if defined(OS_ANDROID)
41 return false; 45 return false;
42 #endif 46 #endif
43 return true; 47 return true;
44 } 48 }
45 49
46 base::FilePath GetDefaultProfileDir(const base::FilePath& user_data_dir) { 50 base::FilePath GetDefaultProfileDir(const base::FilePath& user_data_dir) {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (!entry->IsChild() && !entry->IsLegacySupervised()) { 276 if (!entry->IsChild() && !entry->IsLegacySupervised()) {
273 at_least_one_regular_profile_present = true; 277 at_least_one_regular_profile_present = true;
274 278
275 if (!entry->IsSigninRequired()) 279 if (!entry->IsSigninRequired())
276 return false; 280 return false;
277 } 281 }
278 } 282 }
279 return at_least_one_regular_profile_present; 283 return at_least_one_regular_profile_present;
280 } 284 }
281 285
286 bool IsPublicSession() {
287 #if defined(OS_CHROMEOS)
288 if (chromeos::LoginState::IsInitialized()) {
289 return chromeos::LoginState::Get()->IsPublicSessionUser();
290 }
291 #endif
292 return false;
293 }
294
282 } // namespace profiles 295 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profiles_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698