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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/ui/user_manager.h" | 37 #include "chrome/browser/ui/user_manager.h" |
38 #include "chrome/common/chrome_features.h" | 38 #include "chrome/common/chrome_features.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
41 #include "components/browser_sync/profile_sync_service.h" | 41 #include "components/browser_sync/profile_sync_service.h" |
42 #include "components/flags_ui/pref_service_flags_storage.h" | 42 #include "components/flags_ui/pref_service_flags_storage.h" |
43 #include "components/prefs/pref_service.h" | 43 #include "components/prefs/pref_service.h" |
44 #include "components/signin/core/browser/account_reconcilor.h" | 44 #include "components/signin/core/browser/account_reconcilor.h" |
45 #include "components/signin/core/browser/account_tracker_service.h" | 45 #include "components/signin/core/browser/account_tracker_service.h" |
46 #include "components/signin/core/browser/signin_manager.h" | 46 #include "components/signin/core/browser/signin_manager.h" |
47 #include "components/signin/core/common/profile_management_switches.h" | |
48 #include "components/signin/core/common/signin_pref_names.h" | 47 #include "components/signin/core/common/signin_pref_names.h" |
49 #include "components/signin/core/common/signin_switches.h" | 48 #include "components/signin/core/common/signin_switches.h" |
50 #include "content/public/browser/browser_thread.h" | 49 #include "content/public/browser/browser_thread.h" |
51 #include "content/public/browser/user_metrics.h" | 50 #include "content/public/browser/user_metrics.h" |
52 #include "extensions/features/features.h" | 51 #include "extensions/features/features.h" |
53 #include "net/base/escape.h" | 52 #include "net/base/escape.h" |
54 | 53 |
55 #if BUILDFLAG(ENABLE_EXTENSIONS) | 54 #if BUILDFLAG(ENABLE_EXTENSIONS) |
56 #include "chrome/browser/extensions/extension_service.h" | 55 #include "chrome/browser/extensions/extension_service.h" |
57 #include "extensions/browser/extension_prefs.h" | 56 #include "extensions/browser/extension_prefs.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 DCHECK(profile); | 399 DCHECK(profile); |
401 if (profile) { | 400 if (profile) { |
402 BrowserList::CloseAllBrowsersWithProfile( | 401 BrowserList::CloseAllBrowsersWithProfile( |
403 profile, base::Bind(&LockBrowserCloseSuccess), | 402 profile, base::Bind(&LockBrowserCloseSuccess), |
404 BrowserList::CloseCallback(), false); | 403 BrowserList::CloseCallback(), false); |
405 } | 404 } |
406 } | 405 } |
407 | 406 |
408 bool IsLockAvailable(Profile* profile) { | 407 bool IsLockAvailable(Profile* profile) { |
409 DCHECK(profile); | 408 DCHECK(profile); |
410 if (!switches::IsNewProfileManagement()) | |
411 return false; | |
412 | |
413 if (profile->IsGuestSession() || profile->IsSystemProfile()) | 409 if (profile->IsGuestSession() || profile->IsSystemProfile()) |
414 return false; | 410 return false; |
415 | 411 |
416 std::string hosted_domain = profile->GetPrefs()-> | 412 std::string hosted_domain = profile->GetPrefs()-> |
417 GetString(prefs::kGoogleServicesHostedDomain); | 413 GetString(prefs::kGoogleServicesHostedDomain); |
418 // TODO(mlerman): After one release remove any hosted_domain reference to the | 414 // TODO(mlerman): After one release remove any hosted_domain reference to the |
419 // pref, since all users will have this in the AccountTrackerService. | 415 // pref, since all users will have this in the AccountTrackerService. |
420 if (hosted_domain.empty()) { | 416 if (hosted_domain.empty()) { |
421 AccountTrackerService* account_tracker = | 417 AccountTrackerService* account_tracker = |
422 AccountTrackerServiceFactory::GetForProfile(profile); | 418 AccountTrackerServiceFactory::GetForProfile(profile); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 PrefService* local_state = g_browser_process->local_state(); | 527 PrefService* local_state = g_browser_process->local_state(); |
532 const bool dismissed = local_state->GetBoolean( | 528 const bool dismissed = local_state->GetBoolean( |
533 prefs::kProfileAvatarRightClickTutorialDismissed); | 529 prefs::kProfileAvatarRightClickTutorialDismissed); |
534 | 530 |
535 // Don't show the tutorial if it's already been dismissed or if right-clicking | 531 // Don't show the tutorial if it's already been dismissed or if right-clicking |
536 // wouldn't show any targets. | 532 // wouldn't show any targets. |
537 return !dismissed && HasProfileSwitchTargets(profile); | 533 return !dismissed && HasProfileSwitchTargets(profile); |
538 } | 534 } |
539 | 535 |
540 } // namespace profiles | 536 } // namespace profiles |
OLD | NEW |