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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 BrowserList::CloseAllBrowsersWithProfile( | 376 BrowserList::CloseAllBrowsersWithProfile( |
377 profile, base::Bind(&LockBrowserCloseSuccess)); | 377 profile, base::Bind(&LockBrowserCloseSuccess)); |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 bool IsLockAvailable(Profile* profile) { | 381 bool IsLockAvailable(Profile* profile) { |
382 DCHECK(profile); | 382 DCHECK(profile); |
383 if (!switches::IsNewProfileManagement()) | 383 if (!switches::IsNewProfileManagement()) |
384 return false; | 384 return false; |
385 | 385 |
386 if (profile->IsGuestSession()) | 386 if (profile->IsGuestSession() || profile->IsSystemProfile()) |
387 return false; | 387 return false; |
388 | 388 |
389 std::string hosted_domain = profile->GetPrefs()-> | 389 std::string hosted_domain = profile->GetPrefs()-> |
390 GetString(prefs::kGoogleServicesHostedDomain); | 390 GetString(prefs::kGoogleServicesHostedDomain); |
391 // TODO(mlerman): After one release remove any hosted_domain reference to the | 391 // TODO(mlerman): After one release remove any hosted_domain reference to the |
392 // pref, since all users will have this in the AccountTrackerService. | 392 // pref, since all users will have this in the AccountTrackerService. |
393 if (hosted_domain.empty()) { | 393 if (hosted_domain.empty()) { |
394 AccountTrackerService* account_tracker = | 394 AccountTrackerService* account_tracker = |
395 AccountTrackerServiceFactory::GetForProfile(profile); | 395 AccountTrackerServiceFactory::GetForProfile(profile); |
396 std::string account_id = | 396 std::string account_id = |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 return; | 519 return; |
520 case BrowserWindow::AVATAR_BUBBLE_MODE_FAST_USER_SWITCH: | 520 case BrowserWindow::AVATAR_BUBBLE_MODE_FAST_USER_SWITCH: |
521 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER; | 521 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_FAST_PROFILE_CHOOSER; |
522 return; | 522 return; |
523 default: | 523 default: |
524 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 524 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
525 } | 525 } |
526 } | 526 } |
527 | 527 |
528 } // namespace profiles | 528 } // namespace profiles |
OLD | NEW |