| 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 // Now activate/deactivate anything not handled by the delegate yet. | 763 // Now activate/deactivate anything not handled by the delegate yet. |
| 764 | 764 |
| 765 #if defined(ENABLE_THEMES) | 765 #if defined(ENABLE_THEMES) |
| 766 // Re-set the default theme to turn the SU theme on/off. | 766 // Re-set the default theme to turn the SU theme on/off. |
| 767 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); | 767 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); |
| 768 if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme()) { | 768 if (theme_service->UsingDefaultTheme() || theme_service->UsingSystemTheme()) { |
| 769 ThemeServiceFactory::GetForProfile(profile_)->UseDefaultTheme(); | 769 ThemeServiceFactory::GetForProfile(profile_)->UseDefaultTheme(); |
| 770 } | 770 } |
| 771 #endif | 771 #endif |
| 772 | 772 |
| 773 ProfileSyncService* sync_service = |
| 774 ProfileSyncServiceFactory::GetForProfile(profile_); |
| 775 sync_service->SetEncryptEverythingAllowed(!active_); |
| 776 |
| 773 GetSettingsService()->SetActive(active_); | 777 GetSettingsService()->SetActive(active_); |
| 774 | 778 |
| 775 #if defined(ENABLE_EXTENSIONS) | 779 #if defined(ENABLE_EXTENSIONS) |
| 776 SetExtensionsActive(); | 780 SetExtensionsActive(); |
| 777 #endif | 781 #endif |
| 778 | 782 |
| 779 if (active_) { | 783 if (active_) { |
| 780 if (CommandLine::ForCurrentProcess()->HasSwitch( | 784 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 781 switches::kPermissionRequestApiUrl)) { | 785 switches::kPermissionRequestApiUrl)) { |
| 782 GURL url(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 786 GURL url(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 // The active user can be NULL in unit tests. | 985 // The active user can be NULL in unit tests. |
| 982 if (user_manager::UserManager::Get()->GetActiveUser()) { | 986 if (user_manager::UserManager::Get()->GetActiveUser()) { |
| 983 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( | 987 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( |
| 984 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); | 988 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); |
| 985 } | 989 } |
| 986 return std::string(); | 990 return std::string(); |
| 987 #else | 991 #else |
| 988 return profile_->GetPrefs()->GetString(prefs::kProfileName); | 992 return profile_->GetPrefs()->GetString(prefs::kProfileName); |
| 989 #endif | 993 #endif |
| 990 } | 994 } |
| OLD | NEW |