OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_service.h" | 5 #include "chrome/browser/supervised_user/supervised_user_service.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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 // Now activate/deactivate anything not handled by the delegate yet. | 744 // Now activate/deactivate anything not handled by the delegate yet. |
745 | 745 |
746 #if defined(ENABLE_THEMES) | 746 #if defined(ENABLE_THEMES) |
747 // Re-set the default theme to turn the SU theme on/off. | 747 // Re-set the default theme to turn the SU theme on/off. |
748 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); | 748 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); |
749 if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme()) { | 749 if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme()) { |
750 ThemeServiceFactory::GetForProfile(profile_)->UseDefaultTheme(); | 750 ThemeServiceFactory::GetForProfile(profile_)->UseDefaultTheme(); |
751 } | 751 } |
752 #endif | 752 #endif |
753 | 753 |
| 754 ProfileSyncService* sync_service = |
| 755 ProfileSyncServiceFactory::GetForProfile(profile_); |
| 756 sync_service->SetEncryptEverythingAllowed(!active_); |
| 757 |
754 GetSettingsService()->SetActive(active_); | 758 GetSettingsService()->SetActive(active_); |
755 | 759 |
756 #if defined(ENABLE_EXTENSIONS) | 760 #if defined(ENABLE_EXTENSIONS) |
757 SetExtensionsActive(); | 761 SetExtensionsActive(); |
758 #endif | 762 #endif |
759 | 763 |
760 if (active_) { | 764 if (active_) { |
761 if (CommandLine::ForCurrentProcess()->HasSwitch( | 765 if (CommandLine::ForCurrentProcess()->HasSwitch( |
762 switches::kPermissionRequestApiUrl)) { | 766 switches::kPermissionRequestApiUrl)) { |
763 GURL url(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 767 GURL url(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 // The active user can be NULL in unit tests. | 966 // The active user can be NULL in unit tests. |
963 if (user_manager::UserManager::Get()->GetActiveUser()) { | 967 if (user_manager::UserManager::Get()->GetActiveUser()) { |
964 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( | 968 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( |
965 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); | 969 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); |
966 } | 970 } |
967 return std::string(); | 971 return std::string(); |
968 #else | 972 #else |
969 return profile_->GetPrefs()->GetString(prefs::kProfileName); | 973 return profile_->GetPrefs()->GetString(prefs::kProfileName); |
970 #endif | 974 #endif |
971 } | 975 } |
OLD | NEW |