| OLD | NEW |
| 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/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 BrowserList::CloseAllBrowsersWithProfile( | 377 BrowserList::CloseAllBrowsersWithProfile( |
| 378 profile, base::Bind(&LockBrowserCloseSuccess)); | 378 profile, base::Bind(&LockBrowserCloseSuccess)); |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 bool IsLockAvailable(Profile* profile) { | 382 bool IsLockAvailable(Profile* profile) { |
| 383 DCHECK(profile); | 383 DCHECK(profile); |
| 384 if (!switches::IsNewProfileManagement()) | 384 if (!switches::IsNewProfileManagement()) |
| 385 return false; | 385 return false; |
| 386 | 386 |
| 387 if (profile->IsGuestSession()) | 387 if (profile->IsGuestSession() || profile->IsSystemProfile()) |
| 388 return false; | 388 return false; |
| 389 | 389 |
| 390 std::string hosted_domain = profile->GetPrefs()-> | 390 std::string hosted_domain = profile->GetPrefs()-> |
| 391 GetString(prefs::kGoogleServicesHostedDomain); | 391 GetString(prefs::kGoogleServicesHostedDomain); |
| 392 // TODO(mlerman): After one release remove any hosted_domain reference to the | 392 // TODO(mlerman): After one release remove any hosted_domain reference to the |
| 393 // pref, since all users will have this in the AccountTrackerService. | 393 // pref, since all users will have this in the AccountTrackerService. |
| 394 if (hosted_domain.empty()) { | 394 if (hosted_domain.empty()) { |
| 395 AccountTrackerService* account_tracker = | 395 AccountTrackerService* account_tracker = |
| 396 AccountTrackerServiceFactory::GetForProfile(profile); | 396 AccountTrackerServiceFactory::GetForProfile(profile); |
| 397 std::string account_id = | 397 std::string account_id = |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 PrefService* local_state = g_browser_process->local_state(); | 542 PrefService* local_state = g_browser_process->local_state(); |
| 543 const bool dismissed = local_state->GetBoolean( | 543 const bool dismissed = local_state->GetBoolean( |
| 544 prefs::kProfileAvatarRightClickTutorialDismissed); | 544 prefs::kProfileAvatarRightClickTutorialDismissed); |
| 545 | 545 |
| 546 // Don't show the tutorial if it's already been dismissed or if right-clicking | 546 // Don't show the tutorial if it's already been dismissed or if right-clicking |
| 547 // wouldn't show any targets. | 547 // wouldn't show any targets. |
| 548 return !dismissed && HasProfileSwitchTargets(profile); | 548 return !dismissed && HasProfileSwitchTargets(profile); |
| 549 } | 549 } |
| 550 | 550 |
| 551 } // namespace profiles | 551 } // namespace profiles |
| OLD | NEW |