diff options
author | treib@chromium.org <treib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-12 17:14:05 +0000 |
---|---|---|
committer | treib@chromium.org <treib@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-12 17:14:05 +0000 |
commit | d20d04315d2dabd1e5d613adb8dda59a10325508 (patch) | |
tree | 27fb5092d2a17611e07c0057edbeb341c8c596b0 | |
parent | d882d90bf572cb52afe79970acac4f7bd14da5d4 (diff) | |
download | chromium_src-d20d04315d2dabd1e5d613adb8dda59a10325508.zip chromium_src-d20d04315d2dabd1e5d613adb8dda59a10325508.tar.gz chromium_src-d20d04315d2dabd1e5d613adb8dda59a10325508.tar.bz2 |
Rename "managed (mode|user)" to "supervised user" (part 1)
This CL changes:
- "IsManaged" and similar methods in Profile, ProfileInfoCache, and a few other places (which mostly forward to either of those)
- Enum and constant names
- Variable names
- Comments
Still missing:
- I almost certainly missed a few variables and comments
- The actual SU implementation, i.e. c/b/managed_mode/
- JavaScript
- Resource names
But since this CL is already way too huge, I'll try to commit this part now and do the rest in one or more followup CLs.
TBR=thakis@chromium.org (chrome/)
TBR=rogerta@chromium.org (google_apis/)
TBR=haitaol@chromium.org (sync/ and components/sync_driver/)
All the TBRs are simple renames.
BUG=none
Review URL: https://codereview.chromium.org/316863002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276722 0039d316-1c4b-4281-b951-d872f2087c98
137 files changed, 772 insertions, 740 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index c99bf13..3c23641 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -1455,7 +1455,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { [dockMenu addItem:item]; // |profile| can be NULL during unit tests. - if (!profile || !profile->IsManaged()) { + if (!profile || !profile->IsSupervised()) { titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_INCOGNITO_WINDOW_MAC); item.reset( [[NSMenuItem alloc] initWithTitle:titleStr diff --git a/chrome/browser/chromeos/login/fake_login_utils.cc b/chrome/browser/chromeos/login/fake_login_utils.cc index ad8d045..ffb8cff 100644 --- a/chrome/browser/chromeos/login/fake_login_utils.cc +++ b/chrome/browser/chromeos/login/fake_login_utils.cc @@ -69,13 +69,13 @@ void FakeLoginUtils::PrepareProfile(const UserContext& user_context, if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { User* active_user = UserManager::Get()->GetActiveUser(); - std::string managed_user_sync_id = + std::string supervised_user_sync_id = UserManager::Get()->GetSupervisedUserManager()-> GetUserSyncId(active_user->email()); - if (managed_user_sync_id.empty()) - managed_user_sync_id = "DUMMY ID"; - profile->GetPrefs()->SetString(prefs::kManagedUserId, - managed_user_sync_id); + if (supervised_user_sync_id.empty()) + supervised_user_sync_id = "DUMMY ID"; + profile->GetPrefs()->SetString(prefs::kSupervisedUserId, + supervised_user_sync_id); } content::NotificationService::current()->Notify( diff --git a/chrome/browser/chromeos/login/managed/managed_user_test_base.cc b/chrome/browser/chromeos/login/managed/managed_user_test_base.cc index 5a23e1f..3c445a1 100644 --- a/chrome/browser/chromeos/login/managed/managed_user_test_base.cc +++ b/chrome/browser/chromeos/login/managed/managed_user_test_base.cc @@ -57,7 +57,7 @@ ManagedUsersSyncTestAdapter::ManagedUsersSyncTestAdapter(Profile* profile) service_ = ManagedUserSyncServiceFactory::GetForProfile(profile); processor_ = new syncer::FakeSyncChangeProcessor(); service_->MergeDataAndStartSyncing( - syncer::MANAGED_USERS, + syncer::SUPERVISED_USERS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(processor_), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock)); @@ -70,7 +70,7 @@ ManagedUsersSyncTestAdapter::GetFirstChange() { CHECK(HasChanges()) << "GetFirstChange() should only be callled if HasChanges() is true"; const syncer::SyncData& data = processor_->changes().front().sync_data(); - EXPECT_EQ(syncer::MANAGED_USERS, data.GetDataType()); + EXPECT_EQ(syncer::SUPERVISED_USERS, data.GetDataType()); result->CopyFrom(data.GetSpecifics().managed_user()); return result.Pass(); } @@ -106,7 +106,7 @@ ManagedUsersSharedSettingsSyncTestAdapter:: ManagedUserSharedSettingsServiceFactory::GetForBrowserContext(profile); processor_ = new syncer::FakeSyncChangeProcessor(); service_->MergeDataAndStartSyncing( - syncer::MANAGED_USER_SHARED_SETTINGS, + syncer::SUPERVISED_USER_SHARED_SETTINGS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(processor_), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock)); @@ -119,7 +119,7 @@ ManagedUsersSharedSettingsSyncTestAdapter::GetFirstChange() { CHECK(HasChanges()) << "GetFirstChange() should only be callled if HasChanges() is true"; const syncer::SyncData& data = processor_->changes().front().sync_data(); - EXPECT_EQ(syncer::MANAGED_USER_SHARED_SETTINGS, data.GetDataType()); + EXPECT_EQ(syncer::SUPERVISED_USER_SHARED_SETTINGS, data.GetDataType()); result->CopyFrom(data.GetSpecifics().managed_user_shared_setting()); return result.Pass(); } diff --git a/chrome/browser/chromeos/login/session/session_manager.cc b/chrome/browser/chromeos/login/session/session_manager.cc index 14af5a6..b54c7c0 100644 --- a/chrome/browser/chromeos/login/session/session_manager.cc +++ b/chrome/browser/chromeos/login/session/session_manager.cc @@ -379,7 +379,8 @@ void SessionManager::InitProfilePreferences(Profile* profile, std::string managed_user_sync_id = UserManager::Get()->GetSupervisedUserManager()-> GetUserSyncId(active_user->email()); - profile->GetPrefs()->SetString(prefs::kManagedUserId, managed_user_sync_id); + profile->GetPrefs()->SetString(prefs::kSupervisedUserId, + managed_user_sync_id); } else if (UserManager::Get()->IsLoggedInAsRegularUser()) { // Make sure that the google service username is properly set (we do this // on every sign in, not just the first login, to deal with existing diff --git a/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc b/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc index bf519a1..c88c50b 100644 --- a/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc +++ b/chrome/browser/chromeos/profiles/avatar_menu_actions_chromeos.cc @@ -37,7 +37,7 @@ void AvatarMenuActionsChromeOS::EditProfile(Profile* profile, size_t index) { bool AvatarMenuActionsChromeOS::ShouldShowAddNewProfileLink() const { // |browser_| can be NULL in unit_tests. - return (!browser_ || !browser_->profile()->IsManaged()) && + return (!browser_ || !browser_->profile()->IsSupervised()) && UserManager::Get()->GetUsersAdmittedForMultiProfile().size(); } diff --git a/chrome/browser/chromeos/profiles/profile_list_chromeos.cc b/chrome/browser/chromeos/profiles/profile_list_chromeos.cc index 4e20fa4..92bc4a0 100644 --- a/chrome/browser/chromeos/profiles/profile_list_chromeos.cc +++ b/chrome/browser/chromeos/profiles/profile_list_chromeos.cc @@ -61,7 +61,7 @@ void ProfileListChromeOS::RebuildMenu() { item->name = (*it)->GetDisplayName(); item->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i); item->profile_path = profile_info_->GetPathOfProfileAtIndex(i); - item->managed = false; + item->supervised = false; item->signed_in = true; item->active = profile_info_->GetPathOfProfileAtIndex(i) == active_profile_path_; diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index f737704..2d11ae2 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -1318,7 +1318,7 @@ void DeveloperPrivateChoosePathFunction::FileSelectionCanceled() { DeveloperPrivateChoosePathFunction::~DeveloperPrivateChoosePathFunction() {} bool DeveloperPrivateIsProfileManagedFunction::RunSync() { - SetResult(new base::FundamentalValue(GetProfile()->IsManaged())); + SetResult(new base::FundamentalValue(GetProfile()->IsSupervised())); return true; } diff --git a/chrome/browser/extensions/extension_service_test_base.cc b/chrome/browser/extensions/extension_service_test_base.cc index 0413fa3..89548cc 100644 --- a/chrome/browser/extensions/extension_service_test_base.cc +++ b/chrome/browser/extensions/extension_service_test_base.cc @@ -52,8 +52,8 @@ scoped_ptr<TestingProfile> BuildTestingProfile( profile_builder.SetPrefService(prefs.Pass()); } - if (params.profile_is_managed) - profile_builder.SetManagedUserId("asdf"); + if (params.profile_is_supervised) + profile_builder.SetSupervisedUserId("asdf"); profile_builder.SetPath(params.profile_path); return profile_builder.Build(); @@ -63,7 +63,9 @@ scoped_ptr<TestingProfile> BuildTestingProfile( ExtensionServiceTestBase::ExtensionServiceInitParams:: ExtensionServiceInitParams() - : autoupdate_enabled(false), is_first_run(true), profile_is_managed(false) { + : autoupdate_enabled(false), + is_first_run(true), + profile_is_supervised(false) { } // Our message loop may be used in tests which require it to be an IO loop. diff --git a/chrome/browser/extensions/extension_service_test_base.h b/chrome/browser/extensions/extension_service_test_base.h index 66fd953..dea4f4f 100644 --- a/chrome/browser/extensions/extension_service_test_base.h +++ b/chrome/browser/extensions/extension_service_test_base.h @@ -44,9 +44,9 @@ class ExtensionServiceTestBase : public testing::Test { base::FilePath profile_path; base::FilePath pref_file; base::FilePath extensions_install_dir; - bool autoupdate_enabled; // defaults to false. - bool is_first_run; // defaults to true. - bool profile_is_managed; // defaults to false. + bool autoupdate_enabled; // defaults to false. + bool is_first_run; // defaults to true. + bool profile_is_supervised; // defaults to false. // Though you could use this constructor, you probably want to use // CreateDefaultInitParams(), and then make a change or two. diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc index 8ffd5ea..336b8bf 100644 --- a/chrome/browser/extensions/external_provider_impl.cc +++ b/chrome/browser/extensions/external_provider_impl.cc @@ -429,7 +429,7 @@ void ExternalProviderImpl::CreateExternalProviders( #endif #if defined(OS_LINUX) && !defined(OS_CHROMEOS) - if (!profile->IsManaged()) { + if (!profile->IsSupervised()) { provider_list->push_back( linked_ptr<ExternalProviderInterface>( new ExternalProviderImpl( @@ -446,8 +446,8 @@ void ExternalProviderImpl::CreateExternalProviders( #if defined(OS_CHROMEOS) if (!is_chromeos_demo_session && !is_chrome_os_public_session) { - int external_apps_path_id = profile->IsManaged() ? - chrome::DIR_MANAGED_USERS_DEFAULT_APPS : + int external_apps_path_id = profile->IsSupervised() ? + chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS : chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS; provider_list->push_back( linked_ptr<ExternalProviderInterface>(new ExternalProviderImpl( @@ -488,7 +488,7 @@ void ExternalProviderImpl::CreateExternalProviders( } #endif - if (!profile->IsManaged() && !is_chromeos_demo_session) { + if (!profile->IsSupervised() && !is_chromeos_demo_session) { #if !defined(OS_WIN) provider_list->push_back( linked_ptr<ExternalProviderInterface>( diff --git a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc index eb2cb8f..d89d9a7 100644 --- a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc +++ b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc @@ -177,7 +177,7 @@ class WebstoreStartupInstallerManagedUsersTest // InProcessBrowserTest overrides: virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { WebstoreStartupInstallerTest::SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); + command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); } }; diff --git a/chrome/browser/managed_mode/managed_mode_browsertest.cc b/chrome/browser/managed_mode/managed_mode_browsertest.cc index e1ee234..9af827e 100644 --- a/chrome/browser/managed_mode/managed_mode_browsertest.cc +++ b/chrome/browser/managed_mode/managed_mode_browsertest.cc @@ -126,7 +126,7 @@ class ManagedModeBlockModeTest : public InProcessBrowserTest { "MAP *.new-example.com " + host_port + "," + "MAP *.a.com " + host_port); - command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); + command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); } // Acts like a synchronous call to history's QueryHistory. Modified from diff --git a/chrome/browser/managed_mode/managed_mode_interstitial.cc b/chrome/browser/managed_mode/managed_mode_interstitial.cc index 9d97ccc..0aa1c70 100644 --- a/chrome/browser/managed_mode/managed_mode_interstitial.cc +++ b/chrome/browser/managed_mode/managed_mode_interstitial.cc @@ -98,15 +98,15 @@ bool ManagedModeInterstitial::Init() { PrefService* prefs = profile->GetPrefs(); pref_change_registrar_.Init(prefs); pref_change_registrar_.Add( - prefs::kDefaultManagedModeFilteringBehavior, + prefs::kDefaultSupervisedUserFilteringBehavior, base::Bind(&ManagedModeInterstitial::OnFilteringPrefsChanged, base::Unretained(this))); pref_change_registrar_.Add( - prefs::kManagedModeManualHosts, + prefs::kSupervisedUserManualHosts, base::Bind(&ManagedModeInterstitial::OnFilteringPrefsChanged, base::Unretained(this))); pref_change_registrar_.Add( - prefs::kManagedModeManualURLs, + prefs::kSupervisedUserManualURLs, base::Bind(&ManagedModeInterstitial::OnFilteringPrefsChanged, base::Unretained(this))); diff --git a/chrome/browser/managed_mode/managed_mode_resource_throttle_browsertest.cc b/chrome/browser/managed_mode/managed_mode_resource_throttle_browsertest.cc index d775d98..5b5baf8 100644 --- a/chrome/browser/managed_mode/managed_mode_resource_throttle_browsertest.cc +++ b/chrome/browser/managed_mode/managed_mode_resource_throttle_browsertest.cc @@ -47,7 +47,7 @@ void ManagedModeResourceThrottleTest::SetUpOnMainThread() { void ManagedModeResourceThrottleTest::SetUpCommandLine( CommandLine* command_line) { - command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); + command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); } // Tests that showing the blocking interstitial for a WebContents without a diff --git a/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc b/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc index 10984cc..4c25d87 100644 --- a/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc +++ b/chrome/browser/managed_mode/managed_user_refresh_token_fetcher.cc @@ -22,7 +22,7 @@ #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_status.h" -using GaiaConstants::kChromeSyncManagedOAuth2Scope; +using GaiaConstants::kChromeSyncSupervisedOAuth2Scope; using base::Time; using gaia::GaiaOAuthClient; using net::URLFetcher; @@ -159,7 +159,7 @@ void ManagedUserRefreshTokenFetcherImpl::OnGetTokenSuccess( kIssueTokenBodyFormat, net::EscapeUrlEncodedData( GaiaUrls::GetInstance()->oauth2_chrome_client_id(), true).c_str(), - net::EscapeUrlEncodedData(kChromeSyncManagedOAuth2Scope, true).c_str(), + net::EscapeUrlEncodedData(kChromeSyncSupervisedOAuth2Scope, true).c_str(), net::EscapeUrlEncodedData(managed_user_id_, true).c_str(), net::EscapeUrlEncodedData(device_name_, true).c_str()); url_fetcher_->SetUploadData("application/x-www-form-urlencoded", body); diff --git a/chrome/browser/managed_mode/managed_user_registration_utility.cc b/chrome/browser/managed_mode/managed_user_registration_utility.cc index 1ca6a04..6d2d8e1 100644 --- a/chrome/browser/managed_mode/managed_user_registration_utility.cc +++ b/chrome/browser/managed_mode/managed_user_registration_utility.cc @@ -230,7 +230,7 @@ void ManagedUserRegistrationUtilityImpl::Register( bool need_password_update = !info.password_data.empty(); const base::DictionaryValue* dict = - prefs_->GetDictionary(prefs::kManagedUsers); + prefs_->GetDictionary(prefs::kSupervisedUsers); is_existing_managed_user_ = dict->HasKey(managed_user_id); if (!is_existing_managed_user_) { managed_user_sync_service_->AddManagedUser(pending_managed_user_id_, @@ -351,7 +351,7 @@ void ManagedUserRegistrationUtilityImpl::OnReceivedToken( void ManagedUserRegistrationUtilityImpl::CompleteRegistrationIfReady() { bool skip_check = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kNoManagedUserAcknowledgmentCheck); + switches::kNoSupervisedUserAcknowledgmentCheck); if (!pending_managed_user_acknowledged_ && !skip_check) return; diff --git a/chrome/browser/managed_mode/managed_user_registration_utility_unittest.cc b/chrome/browser/managed_mode/managed_user_registration_utility_unittest.cc index 302f787..ed33dcd 100644 --- a/chrome/browser/managed_mode/managed_user_registration_utility_unittest.cc +++ b/chrome/browser/managed_mode/managed_user_registration_utility_unittest.cc @@ -27,7 +27,7 @@ #include "testing/gtest/include/gtest/gtest.h" using sync_pb::ManagedUserSpecifics; -using syncer::MANAGED_USERS; +using syncer::SUPERVISED_USERS; using syncer::SyncChange; using syncer::SyncChangeList; using syncer::SyncChangeProcessor; @@ -39,7 +39,7 @@ using syncer::SyncMergeResult; namespace { -const char kManagedUserToken[] = "managedusertoken"; +const char kSupervisedUserToken[] = "supervisedusertoken"; class MockChangeProcessor : public SyncChangeProcessor { public: @@ -80,7 +80,7 @@ class MockManagedUserRefreshTokenFetcher const std::string& device_name, const TokenCallback& callback) OVERRIDE { GoogleServiceAuthError error(GoogleServiceAuthError::NONE); - callback.Run(error, kManagedUserToken); + callback.Run(error, kSupervisedUserToken); } }; @@ -180,7 +180,7 @@ ManagedUserRegistrationUtilityTest::CreateErrorFactory() { SyncMergeResult ManagedUserRegistrationUtilityTest::StartInitialSync() { SyncDataList initial_sync_data; SyncMergeResult result = - service()->MergeDataAndStartSyncing(MANAGED_USERS, + service()->MergeDataAndStartSyncing(SUPERVISED_USERS, initial_sync_data, CreateChangeProcessor(), CreateErrorFactory()); @@ -249,7 +249,7 @@ TEST_F(ManagedUserRegistrationUtilityTest, Register) { ManagedUserRegistrationUtility::GenerateNewManagedUserId(), ManagedUserRegistrationInfo(base::ASCIIToUTF16("Dug"), 0), GetRegistrationCallback()); - EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); + EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); Acknowledge(); EXPECT_TRUE(received_callback()); @@ -262,7 +262,7 @@ TEST_F(ManagedUserRegistrationUtilityTest, RegisterBeforeInitialSync) { ManagedUserRegistrationUtility::GenerateNewManagedUserId(), ManagedUserRegistrationInfo(base::ASCIIToUTF16("Nemo"), 5), GetRegistrationCallback()); - EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); + EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); StartInitialSync(); Acknowledge(); @@ -277,9 +277,9 @@ TEST_F(ManagedUserRegistrationUtilityTest, SyncServiceShutdownBeforeRegFinish) { ManagedUserRegistrationUtility::GenerateNewManagedUserId(), ManagedUserRegistrationInfo(base::ASCIIToUTF16("Remy"), 12), GetRegistrationCallback()); - EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); + EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); service()->Shutdown(); - EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); + EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); EXPECT_TRUE(received_callback()); EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); EXPECT_EQ(std::string(), token()); @@ -291,9 +291,9 @@ TEST_F(ManagedUserRegistrationUtilityTest, StopSyncingBeforeRegFinish) { ManagedUserRegistrationUtility::GenerateNewManagedUserId(), ManagedUserRegistrationInfo(base::ASCIIToUTF16("Mike"), 17), GetRegistrationCallback()); - EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); - service()->StopSyncing(MANAGED_USERS); - EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kManagedUsers)->size()); + EXPECT_EQ(1u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); + service()->StopSyncing(SUPERVISED_USERS); + EXPECT_EQ(0u, prefs()->GetDictionary(prefs::kSupervisedUsers)->size()); EXPECT_TRUE(received_callback()); EXPECT_EQ(GoogleServiceAuthError::REQUEST_CANCELED, error().state()); EXPECT_EQ(std::string(), token()); diff --git a/chrome/browser/managed_mode/managed_user_service.cc b/chrome/browser/managed_mode/managed_user_service.cc index 8175ebf1..dab571a 100644 --- a/chrome/browser/managed_mode/managed_user_service.cc +++ b/chrome/browser/managed_mode/managed_user_service.cc @@ -154,47 +154,48 @@ void ManagedUserService::Shutdown() { } bool ManagedUserService::ProfileIsManaged() const { - return profile_->IsManaged(); + return profile_->IsSupervised(); } // static void ManagedUserService::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterDictionaryPref( - prefs::kManagedModeManualHosts, + prefs::kSupervisedUserManualHosts, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterDictionaryPref( - prefs::kManagedModeManualURLs, + prefs::kSupervisedUserManualURLs, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterIntegerPref( - prefs::kDefaultManagedModeFilteringBehavior, ManagedModeURLFilter::ALLOW, + prefs::kDefaultSupervisedUserFilteringBehavior, + ManagedModeURLFilter::ALLOW, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref( - prefs::kManagedUserCustodianEmail, std::string(), + prefs::kSupervisedUserCustodianEmail, std::string(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref( - prefs::kManagedUserCustodianName, std::string(), + prefs::kSupervisedUserCustodianName, std::string(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterBooleanPref(prefs::kManagedUserCreationAllowed, true, + registry->RegisterBooleanPref(prefs::kSupervisedUserCreationAllowed, true, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); } // static void ManagedUserService::MigrateUserPrefs(PrefService* prefs) { - if (!prefs->HasPrefPath(prefs::kProfileIsManaged)) + if (!prefs->HasPrefPath(prefs::kProfileIsSupervised)) return; - bool is_managed = prefs->GetBoolean(prefs::kProfileIsManaged); - prefs->ClearPref(prefs::kProfileIsManaged); + bool is_managed = prefs->GetBoolean(prefs::kProfileIsSupervised); + prefs->ClearPref(prefs::kProfileIsSupervised); if (!is_managed) return; - std::string managed_user_id = prefs->GetString(prefs::kManagedUserId); + std::string managed_user_id = prefs->GetString(prefs::kSupervisedUserId); if (!managed_user_id.empty()) return; - prefs->SetString(prefs::kManagedUserId, "Dummy ID"); + prefs->SetString(prefs::kSupervisedUserId, "Dummy ID"); } void ManagedUserService::SetDelegate(Delegate* delegate) { @@ -240,7 +241,7 @@ std::string ManagedUserService::GetCustodianEmailAddress() const { GetManagerDisplayEmail( chromeos::UserManager::Get()->GetActiveUser()->email()); #else - return profile_->GetPrefs()->GetString(prefs::kManagedUserCustodianEmail); + return profile_->GetPrefs()->GetString(prefs::kSupervisedUserCustodianEmail); #endif } @@ -251,7 +252,7 @@ std::string ManagedUserService::GetCustodianName() const { chromeos::UserManager::Get()->GetActiveUser()->email())); #else std::string name = profile_->GetPrefs()->GetString( - prefs::kManagedUserCustodianName); + prefs::kSupervisedUserCustodianName); return name.empty() ? GetCustodianEmailAddress() : name; #endif } @@ -361,7 +362,7 @@ void ManagedUserService::SetupSync() { bool sync_everything = false; syncer::ModelTypeSet synced_datatypes; - synced_datatypes.Put(syncer::MANAGED_USER_SETTINGS); + synced_datatypes.Put(syncer::SUPERVISED_USER_SETTINGS); service->OnUserChoseDatatypes(sync_everything, synced_datatypes); // Notify ProfileSyncService that we are done with configuration. @@ -416,7 +417,7 @@ ManagedUserSettingsService* ManagedUserService::GetSettingsService() { void ManagedUserService::OnManagedUserIdChanged() { std::string managed_user_id = - profile_->GetPrefs()->GetString(prefs::kManagedUserId); + profile_->GetPrefs()->GetString(prefs::kSupervisedUserId); SetActive(!managed_user_id.empty()); } @@ -424,7 +425,7 @@ void ManagedUserService::OnDefaultFilteringBehaviorChanged() { DCHECK(ProfileIsManaged()); int behavior_value = profile_->GetPrefs()->GetInteger( - prefs::kDefaultManagedModeFilteringBehavior); + prefs::kDefaultSupervisedUserFilteringBehavior); ManagedModeURLFilter::FilteringBehavior behavior = ManagedModeURLFilter::BehaviorFromInt(behavior_value); url_filter_context_.SetDefaultFilteringBehavior(behavior); @@ -471,7 +472,7 @@ void ManagedUserService::AddAccessRequest(const GURL& url) { ManagedUserService::ManualBehavior ManagedUserService::GetManualBehaviorForHost( const std::string& hostname) { const base::DictionaryValue* dict = - profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualHosts); + profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUserManualHosts); bool allow = false; if (!dict->GetBooleanWithoutPathExpansion(hostname, &allow)) return MANUAL_NONE; @@ -482,7 +483,7 @@ ManagedUserService::ManualBehavior ManagedUserService::GetManualBehaviorForHost( ManagedUserService::ManualBehavior ManagedUserService::GetManualBehaviorForURL( const GURL& url) { const base::DictionaryValue* dict = - profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); + profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUserManualURLs); GURL normalized_url = ManagedModeURLFilter::Normalize(url); bool allow = false; if (!dict->GetBooleanWithoutPathExpansion(normalized_url.spec(), &allow)) @@ -494,7 +495,7 @@ ManagedUserService::ManualBehavior ManagedUserService::GetManualBehaviorForURL( void ManagedUserService::GetManualExceptionsForHost(const std::string& host, std::vector<GURL>* urls) { const base::DictionaryValue* dict = - profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); + profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUserManualURLs); for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { GURL url(it.key()); if (url.host() == host) @@ -528,7 +529,7 @@ void ManagedUserService::Init() { pref_change_registrar_.Init(profile_->GetPrefs()); pref_change_registrar_.Add( - prefs::kManagedUserId, + prefs::kSupervisedUserId, base::Bind(&ManagedUserService::OnManagedUserIdChanged, base::Unretained(this))); @@ -546,9 +547,10 @@ void ManagedUserService::SetActive(bool active) { ->Init(); CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kManagedUserSyncToken)) { + if (command_line->HasSwitch(switches::kSupervisedUserSyncToken)) { InitSync( - command_line->GetSwitchValueASCII(switches::kManagedUserSyncToken)); + command_line->GetSwitchValueASCII( + switches::kSupervisedUserSyncToken)); } ProfileOAuth2TokenService* token_service = @@ -587,7 +589,7 @@ void ManagedUserService::SetActive(bool active) { ManagedUserSharedSettingsServiceFactory::GetForBrowserContext( profile_), pref_service->GetString(prefs::kProfileName), - pref_service->GetString(prefs::kManagedUserId))); + pref_service->GetString(prefs::kSupervisedUserId))); } if (management_policy) @@ -597,13 +599,13 @@ void ManagedUserService::SetActive(bool active) { extensions::ExtensionRegistry::Get(profile_)); pref_change_registrar_.Add( - prefs::kDefaultManagedModeFilteringBehavior, + prefs::kDefaultSupervisedUserFilteringBehavior, base::Bind(&ManagedUserService::OnDefaultFilteringBehaviorChanged, base::Unretained(this))); - pref_change_registrar_.Add(prefs::kManagedModeManualHosts, + pref_change_registrar_.Add(prefs::kSupervisedUserManualHosts, base::Bind(&ManagedUserService::UpdateManualHosts, base::Unretained(this))); - pref_change_registrar_.Add(prefs::kManagedModeManualURLs, + pref_change_registrar_.Add(prefs::kSupervisedUserManualURLs, base::Bind(&ManagedUserService::UpdateManualURLs, base::Unretained(this))); @@ -626,9 +628,10 @@ void ManagedUserService::SetActive(bool active) { extension_registry_observer_.RemoveAll(); - pref_change_registrar_.Remove(prefs::kDefaultManagedModeFilteringBehavior); - pref_change_registrar_.Remove(prefs::kManagedModeManualHosts); - pref_change_registrar_.Remove(prefs::kManagedModeManualURLs); + pref_change_registrar_.Remove( + prefs::kDefaultSupervisedUserFilteringBehavior); + pref_change_registrar_.Remove(prefs::kSupervisedUserManualHosts); + pref_change_registrar_.Remove(prefs::kSupervisedUserManualURLs); if (waiting_for_sync_initialization_) { ProfileSyncService* sync_service = @@ -650,7 +653,7 @@ void ManagedUserService::RegisterAndInitSync( const std::string& managed_user_id, const AuthErrorCallback& callback) { DCHECK(ProfileIsManaged()); - DCHECK(!custodian_profile->IsManaged()); + DCHECK(!custodian_profile->IsSupervised()); base::string16 name = base::UTF8ToUTF16( profile_->GetPrefs()->GetString(prefs::kProfileName)); @@ -676,7 +679,7 @@ void ManagedUserService::RegisterAndInitSync( void ManagedUserService::OnCustodianProfileDownloaded( const base::string16& full_name) { - profile_->GetPrefs()->SetString(prefs::kManagedUserCustodianName, + profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianName, base::UTF16ToUTF8(full_name)); } @@ -689,7 +692,7 @@ void ManagedUserService::OnManagedUserRegistered( InitSync(token); SigninManagerBase* signin = SigninManagerFactory::GetForProfile(custodian_profile); - profile_->GetPrefs()->SetString(prefs::kManagedUserCustodianEmail, + profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianEmail, signin->GetAuthenticatedUsername()); // The managed-user profile is now ready for use. @@ -706,7 +709,7 @@ void ManagedUserService::OnManagedUserRegistered( void ManagedUserService::UpdateManualHosts() { const base::DictionaryValue* dict = - profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualHosts); + profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUserManualHosts); scoped_ptr<std::map<std::string, bool> > host_map( new std::map<std::string, bool>()); for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { @@ -720,7 +723,7 @@ void ManagedUserService::UpdateManualHosts() { void ManagedUserService::UpdateManualURLs() { const base::DictionaryValue* dict = - profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); + profile_->GetPrefs()->GetDictionary(prefs::kSupervisedUserManualURLs); scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { bool allow = false; diff --git a/chrome/browser/managed_mode/managed_user_service_browsertest.cc b/chrome/browser/managed_mode/managed_user_service_browsertest.cc index cecbde8..7702154 100644 --- a/chrome/browser/managed_mode/managed_user_service_browsertest.cc +++ b/chrome/browser/managed_mode/managed_user_service_browsertest.cc @@ -30,7 +30,7 @@ class ManagedUserServiceTestManaged : public InProcessBrowserTest { public: // content::BrowserTestBase: virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { - command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); + command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); } }; diff --git a/chrome/browser/managed_mode/managed_user_service_unittest.cc b/chrome/browser/managed_mode/managed_user_service_unittest.cc index 96728df..862bf69 100644 --- a/chrome/browser/managed_mode/managed_user_service_unittest.cc +++ b/chrome/browser/managed_mode/managed_user_service_unittest.cc @@ -103,7 +103,7 @@ TEST_F(ManagedUserServiceTest, GetManualExceptionsForHost) { GURL kMooseURL("http://moose.org/baz"); { DictionaryPrefUpdate update(profile_->GetPrefs(), - prefs::kManagedModeManualURLs); + prefs::kSupervisedUserManualURLs); base::DictionaryValue* dict = update.Get(); dict->SetBooleanWithoutPathExpansion(kExampleFooURL.spec(), true); dict->SetBooleanWithoutPathExpansion(kExampleBarURL.spec(), false); @@ -131,7 +131,7 @@ TEST_F(ManagedUserServiceTest, GetManualExceptionsForHost) { { DictionaryPrefUpdate update(profile_->GetPrefs(), - prefs::kManagedModeManualURLs); + prefs::kSupervisedUserManualURLs); base::DictionaryValue* dict = update.Get(); for (std::vector<GURL>::iterator it = exceptions.begin(); it != exceptions.end(); ++it) { @@ -177,7 +177,7 @@ class ManagedUserServiceExtensionTestBase ExtensionServiceTestBase::SetUp(); ExtensionServiceTestBase::ExtensionServiceInitParams params = CreateDefaultInitParams(); - params.profile_is_managed = is_managed_; + params.profile_is_supervised = is_managed_; InitializeExtensionService(params); ManagedUserServiceFactory::GetForProfile(profile_.get())->Init(); } @@ -232,7 +232,7 @@ TEST_F(ManagedUserServiceExtensionTestUnmanaged, ExtensionManagementPolicyProvider) { ManagedUserService* managed_user_service = ManagedUserServiceFactory::GetForProfile(profile_.get()); - EXPECT_FALSE(profile_->IsManaged()); + EXPECT_FALSE(profile_->IsSupervised()); scoped_refptr<extensions::Extension> extension = MakeExtension(); base::string16 error_1; @@ -250,7 +250,7 @@ TEST_F(ManagedUserServiceExtensionTest, ExtensionManagementPolicyProvider) { ManagedUserServiceFactory::GetForProfile(profile_.get()); ManagedModeURLFilterObserver observer( managed_user_service->GetURLFilterForUIThread()); - ASSERT_TRUE(profile_->IsManaged()); + ASSERT_TRUE(profile_->IsSupervised()); // Wait for the initial update to finish (otherwise we'll get leaks). observer.Wait(); @@ -305,13 +305,15 @@ TEST_F(ManagedUserServiceExtensionTest, InstallContentPacks) { EXPECT_EQ(ManagedModeURLFilter::ALLOW, url_filter->GetFilteringBehaviorForURL(example_url)); - profile_->GetPrefs()->SetInteger(prefs::kDefaultManagedModeFilteringBehavior, - ManagedModeURLFilter::BLOCK); + profile_->GetPrefs()->SetInteger( + prefs::kDefaultSupervisedUserFilteringBehavior, + ManagedModeURLFilter::BLOCK); EXPECT_EQ(ManagedModeURLFilter::BLOCK, url_filter->GetFilteringBehaviorForURL(example_url)); - profile_->GetPrefs()->SetInteger(prefs::kDefaultManagedModeFilteringBehavior, - ManagedModeURLFilter::WARN); + profile_->GetPrefs()->SetInteger( + prefs::kDefaultSupervisedUserFilteringBehavior, + ManagedModeURLFilter::WARN); EXPECT_EQ(ManagedModeURLFilter::WARN, url_filter->GetFilteringBehaviorForURL(example_url)); diff --git a/chrome/browser/managed_mode/managed_user_settings_service.cc b/chrome/browser/managed_mode/managed_user_settings_service.cc index 446c088..4708aae 100644 --- a/chrome/browser/managed_mode/managed_user_settings_service.cc +++ b/chrome/browser/managed_mode/managed_user_settings_service.cc @@ -24,7 +24,7 @@ using base::JSONReader; using base::UserMetricsAction; using base::Value; using content::BrowserThread; -using syncer::MANAGED_USER_SETTINGS; +using syncer::SUPERVISED_USER_SETTINGS; using syncer::ModelType; using syncer::SyncChange; using syncer::SyncChangeList; @@ -59,7 +59,7 @@ void ManagedUserSettingsService::Init( base::SequencedTaskRunner* sequenced_task_runner, bool load_synchronously) { base::FilePath path = - profile_path.Append(chrome::kManagedUserSettingsFilename); + profile_path.Append(chrome::kSupervisedUserSettingsFilename); PersistentPrefStore* store = new JsonPrefStore( path, sequenced_task_runner, scoped_ptr<PrefFilter>()); Init(store); @@ -166,7 +166,7 @@ SyncMergeResult ManagedUserSettingsService::MergeDataAndStartSyncing( const SyncDataList& initial_sync_data, scoped_ptr<SyncChangeProcessor> sync_processor, scoped_ptr<SyncErrorFactory> error_handler) { - DCHECK_EQ(MANAGED_USER_SETTINGS, type); + DCHECK_EQ(SUPERVISED_USER_SETTINGS, type); sync_processor_ = sync_processor.Pass(); error_handler_ = error_handler.Pass(); @@ -174,7 +174,7 @@ SyncMergeResult ManagedUserSettingsService::MergeDataAndStartSyncing( Clear(); for (SyncDataList::const_iterator it = initial_sync_data.begin(); it != initial_sync_data.end(); ++it) { - DCHECK_EQ(MANAGED_USER_SETTINGS, it->GetDataType()); + DCHECK_EQ(SUPERVISED_USER_SETTINGS, it->GetDataType()); const ::sync_pb::ManagedUserSettingSpecifics& managed_user_setting = it->GetSpecifics().managed_user_setting(); scoped_ptr<base::Value> value( @@ -204,7 +204,7 @@ SyncMergeResult ManagedUserSettingsService::MergeDataAndStartSyncing( } queued_items->Clear(); - SyncMergeResult result(MANAGED_USER_SETTINGS); + SyncMergeResult result(SUPERVISED_USER_SETTINGS); // Process all the accumulated changes from the queued items. if (change_list.size() > 0) { store_->ReportValueChanged(kQueuedItems); @@ -217,14 +217,14 @@ SyncMergeResult ManagedUserSettingsService::MergeDataAndStartSyncing( } void ManagedUserSettingsService::StopSyncing(ModelType type) { - DCHECK_EQ(syncer::MANAGED_USER_SETTINGS, type); + DCHECK_EQ(syncer::SUPERVISED_USER_SETTINGS, type); sync_processor_.reset(); error_handler_.reset(); } SyncDataList ManagedUserSettingsService::GetAllSyncData( ModelType type) const { - DCHECK_EQ(syncer::MANAGED_USER_SETTINGS, type); + DCHECK_EQ(syncer::SUPERVISED_USER_SETTINGS, type); SyncDataList data; for (base::DictionaryValue::Iterator it(*GetAtomicSettings()); !it.IsAtEnd(); it.Advance()) { @@ -250,7 +250,7 @@ SyncError ManagedUserSettingsService::ProcessSyncChanges( for (SyncChangeList::const_iterator it = change_list.begin(); it != change_list.end(); ++it) { SyncData data = it->sync_data(); - DCHECK_EQ(MANAGED_USER_SETTINGS, data.GetDataType()); + DCHECK_EQ(SUPERVISED_USER_SETTINGS, data.GetDataType()); const ::sync_pb::ManagedUserSettingSpecifics& managed_user_setting = data.GetSpecifics().managed_user_setting(); std::string key = managed_user_setting.name(); diff --git a/chrome/browser/managed_mode/managed_user_settings_service_unittest.cc b/chrome/browser/managed_mode/managed_user_settings_service_unittest.cc index 99eca5a..70dbc2b 100644 --- a/chrome/browser/managed_mode/managed_user_settings_service_unittest.cc +++ b/chrome/browser/managed_mode/managed_user_settings_service_unittest.cc @@ -67,9 +67,9 @@ class ManagedUserSettingsServiceTest : public ::testing::Test { void StartSyncing(const syncer::SyncDataList& initial_sync_data) { scoped_ptr<syncer::SyncErrorFactory> error_handler( - new MockSyncErrorFactory(syncer::MANAGED_USER_SETTINGS)); + new MockSyncErrorFactory(syncer::SUPERVISED_USER_SETTINGS)); syncer::SyncMergeResult result = settings_service_.MergeDataAndStartSyncing( - syncer::MANAGED_USER_SETTINGS, + syncer::SUPERVISED_USER_SETTINGS, initial_sync_data, CreateSyncProcessor(), error_handler.Pass()); @@ -232,7 +232,7 @@ TEST_F(ManagedUserSettingsServiceTest, UploadItem) { // It should also show up in local Sync data. syncer::SyncDataList sync_data = - settings_service_.GetAllSyncData(syncer::MANAGED_USER_SETTINGS); + settings_service_.GetAllSyncData(syncer::SUPERVISED_USER_SETTINGS); EXPECT_EQ(3u, sync_data.size()); for (syncer::SyncDataList::const_iterator it = sync_data.begin(); it != sync_data.end(); ++it) { @@ -248,7 +248,8 @@ TEST_F(ManagedUserSettingsServiceTest, UploadItem) { EXPECT_EQ(syncer::SyncChange::ACTION_ADD, change.change_type()); VerifySyncDataItem(change.sync_data()); - sync_data = settings_service_.GetAllSyncData(syncer::MANAGED_USER_SETTINGS); + sync_data = settings_service_.GetAllSyncData( + syncer::SUPERVISED_USER_SETTINGS); EXPECT_EQ(4u, sync_data.size()); for (syncer::SyncDataList::const_iterator it = sync_data.begin(); it != sync_data.end(); ++it) { @@ -265,7 +266,8 @@ TEST_F(ManagedUserSettingsServiceTest, UploadItem) { EXPECT_EQ(syncer::SyncChange::ACTION_UPDATE, change.change_type()); VerifySyncDataItem(change.sync_data()); - sync_data = settings_service_.GetAllSyncData(syncer::MANAGED_USER_SETTINGS); + sync_data = settings_service_.GetAllSyncData( + syncer::SUPERVISED_USER_SETTINGS); EXPECT_EQ(4u, sync_data.size()); for (syncer::SyncDataList::const_iterator it = sync_data.begin(); it != sync_data.end(); ++it) { @@ -280,7 +282,8 @@ TEST_F(ManagedUserSettingsServiceTest, UploadItem) { EXPECT_EQ(syncer::SyncChange::ACTION_UPDATE, change.change_type()); VerifySyncDataItem(change.sync_data()); - sync_data = settings_service_.GetAllSyncData(syncer::MANAGED_USER_SETTINGS); + sync_data = settings_service_.GetAllSyncData( + syncer::SUPERVISED_USER_SETTINGS); EXPECT_EQ(4u, sync_data.size()); for (syncer::SyncDataList::const_iterator it = sync_data.begin(); it != sync_data.end(); ++it) { @@ -293,7 +296,7 @@ TEST_F(ManagedUserSettingsServiceTest, UploadItem) { EXPECT_FALSE(settings_->GetWithoutPathExpansion(kSplitItemName, &value)); // Restarting sync should not create any new changes. - settings_service_.StopSyncing(syncer::MANAGED_USER_SETTINGS); + settings_service_.StopSyncing(syncer::SUPERVISED_USER_SETTINGS); StartSyncing(sync_data); ASSERT_EQ(0u, sync_processor_->changes().size()); } diff --git a/chrome/browser/managed_mode/managed_user_shared_settings_service.cc b/chrome/browser/managed_mode/managed_user_shared_settings_service.cc index 2f1b75d..74c0b77 100644 --- a/chrome/browser/managed_mode/managed_user_shared_settings_service.cc +++ b/chrome/browser/managed_mode/managed_user_shared_settings_service.cc @@ -20,7 +20,7 @@ using base::DictionaryValue; using base::Value; -using syncer::MANAGED_USER_SHARED_SETTINGS; +using syncer::SUPERVISED_USER_SHARED_SETTINGS; using syncer::ModelType; using syncer::SyncChange; using syncer::SyncChangeList; @@ -50,11 +50,11 @@ class ScopedManagedUserSharedSettingsUpdate { public: ScopedManagedUserSharedSettingsUpdate(PrefService* prefs, const std::string& mu_id) - : update_(prefs, prefs::kManagedUserSharedSettings), mu_id_(mu_id) { + : update_(prefs, prefs::kSupervisedUserSharedSettings), mu_id_(mu_id) { DCHECK(!mu_id.empty()); // A supervised user can only modify their own settings. - std::string id = prefs->GetString(prefs::kManagedUserId); + std::string id = prefs->GetString(prefs::kSupervisedUserId); DCHECK(id.empty() || id == mu_id); } @@ -128,7 +128,7 @@ const Value* ManagedUserSharedSettingsService::GetValue( const std::string& mu_id, const std::string& key) { const DictionaryValue* data = - prefs_->GetDictionary(prefs::kManagedUserSharedSettings); + prefs_->GetDictionary(prefs::kSupervisedUserSharedSettings); const DictionaryValue* dict = NULL; if (!data->GetDictionaryWithoutPathExpansion(mu_id, &dict)) return NULL; @@ -161,7 +161,7 @@ ManagedUserSharedSettingsService::Subscribe( void ManagedUserSharedSettingsService::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterDictionaryPref( - prefs::kManagedUserSharedSettings, + prefs::kSupervisedUserSharedSettings, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); } @@ -191,7 +191,7 @@ ManagedUserSharedSettingsService::MergeDataAndStartSyncing( const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> error_handler) { - DCHECK_EQ(MANAGED_USER_SHARED_SETTINGS, type); + DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, type); sync_processor_ = sync_processor.Pass(); error_handler_ = error_handler.Pass(); @@ -204,7 +204,7 @@ ManagedUserSharedSettingsService::MergeDataAndStartSyncing( for (SyncDataList::const_iterator it = initial_sync_data.begin(); it != initial_sync_data.end(); ++it) { - DCHECK_EQ(MANAGED_USER_SHARED_SETTINGS, it->GetDataType()); + DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, it->GetDataType()); const ::sync_pb::ManagedUserSharedSettingSpecifics& managed_user_shared_setting = it->GetSpecifics().managed_user_shared_setting(); @@ -230,7 +230,7 @@ ManagedUserSharedSettingsService::MergeDataAndStartSyncing( // that were just synced down. We filter those out using |seen_keys|. SyncChangeList change_list; const DictionaryValue* all_settings = - prefs_->GetDictionary(prefs::kManagedUserSharedSettings); + prefs_->GetDictionary(prefs::kSupervisedUserSharedSettings); for (DictionaryValue::Iterator it(*all_settings); !it.IsAtEnd(); it.Advance()) { const DictionaryValue* dict = NULL; @@ -251,7 +251,7 @@ ManagedUserSharedSettingsService::MergeDataAndStartSyncing( } } - SyncMergeResult result(MANAGED_USER_SHARED_SETTINGS); + SyncMergeResult result(SUPERVISED_USER_SHARED_SETTINGS); // Process all the accumulated changes. if (change_list.size() > 0) { result.set_error( @@ -263,17 +263,17 @@ ManagedUserSharedSettingsService::MergeDataAndStartSyncing( } void ManagedUserSharedSettingsService::StopSyncing(syncer::ModelType type) { - DCHECK_EQ(MANAGED_USER_SHARED_SETTINGS, type); + DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, type); sync_processor_.reset(); error_handler_.reset(); } syncer::SyncDataList ManagedUserSharedSettingsService::GetAllSyncData( syncer::ModelType type) const { - DCHECK_EQ(MANAGED_USER_SHARED_SETTINGS, type); + DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, type); SyncDataList data; const DictionaryValue* all_settings = - prefs_->GetDictionary(prefs::kManagedUserSharedSettings); + prefs_->GetDictionary(prefs::kSupervisedUserSharedSettings); for (DictionaryValue::Iterator it(*all_settings); !it.IsAtEnd(); it.Advance()) { const DictionaryValue* dict = NULL; @@ -293,7 +293,7 @@ syncer::SyncError ManagedUserSharedSettingsService::ProcessSyncChanges( it != change_list.end(); ++it) { SyncData data = it->sync_data(); - DCHECK_EQ(MANAGED_USER_SHARED_SETTINGS, data.GetDataType()); + DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, data.GetDataType()); const ::sync_pb::ManagedUserSharedSettingSpecifics& managed_user_shared_setting = data.GetSpecifics().managed_user_shared_setting(); diff --git a/chrome/browser/managed_mode/managed_user_shared_settings_service_unittest.cc b/chrome/browser/managed_mode/managed_user_shared_settings_service_unittest.cc index f0bc891..20df39e 100644 --- a/chrome/browser/managed_mode/managed_user_shared_settings_service_unittest.cc +++ b/chrome/browser/managed_mode/managed_user_shared_settings_service_unittest.cc @@ -20,7 +20,7 @@ using base::FundamentalValue; using base::StringValue; using base::Value; using sync_pb::ManagedUserSharedSettingSpecifics; -using syncer::MANAGED_USER_SHARED_SETTINGS; +using syncer::SUPERVISED_USER_SHARED_SETTINGS; using syncer::SyncChange; using syncer::SyncChangeList; using syncer::SyncChangeProcessor; @@ -84,9 +84,9 @@ class ManagedUserSharedSettingsServiceTest : public ::testing::Test { void StartSyncing(const syncer::SyncDataList& initial_sync_data) { sync_processor_.reset(new syncer::FakeSyncChangeProcessor); scoped_ptr<syncer::SyncErrorFactory> error_handler( - new MockSyncErrorFactory(MANAGED_USER_SHARED_SETTINGS)); + new MockSyncErrorFactory(SUPERVISED_USER_SHARED_SETTINGS)); SyncMergeResult result = settings_service_.MergeDataAndStartSyncing( - MANAGED_USER_SHARED_SETTINGS, + SUPERVISED_USER_SHARED_SETTINGS, initial_sync_data, scoped_ptr<SyncChangeProcessor>( new SyncChangeProcessorWrapperForTest(sync_processor_.get())), @@ -96,7 +96,7 @@ class ManagedUserSharedSettingsServiceTest : public ::testing::Test { const base::DictionaryValue* GetAllSettings() { return profile_.GetPrefs()->GetDictionary( - prefs::kManagedUserSharedSettings); + prefs::kSupervisedUserSharedSettings); } void VerifySyncChangesAndClear() { @@ -145,7 +145,7 @@ TEST_F(ManagedUserSharedSettingsServiceTest, Empty) { EXPECT_EQ(0u, changed_settings_.size()); EXPECT_EQ( 0u, - settings_service_.GetAllSyncData(MANAGED_USER_SHARED_SETTINGS).size()); + settings_service_.GetAllSyncData(SUPERVISED_USER_SHARED_SETTINGS).size()); EXPECT_EQ(0u, GetAllSettings()->size()); } @@ -174,7 +174,7 @@ TEST_F(ManagedUserSharedSettingsServiceTest, SetAndGet) { EXPECT_EQ( 3u, - settings_service_.GetAllSyncData(MANAGED_USER_SHARED_SETTINGS).size()); + settings_service_.GetAllSyncData(SUPERVISED_USER_SHARED_SETTINGS).size()); EXPECT_EQ(ToJson(&name), ToJson(settings_service_.GetValue(kIdA, "name"))); EXPECT_EQ(ToJson(&age), ToJson(settings_service_.GetValue(kIdA, "age"))); @@ -198,7 +198,7 @@ TEST_F(ManagedUserSharedSettingsServiceTest, Merge) { settings_service_.SetValue(kIdA, "age", age); settings_service_.SetValue(kIdB, "foo", bar); - settings_service_.StopSyncing(MANAGED_USER_SHARED_SETTINGS); + settings_service_.StopSyncing(SUPERVISED_USER_SHARED_SETTINGS); StringValue name("Jill"); StringValue blurp("blurp"); @@ -217,7 +217,7 @@ TEST_F(ManagedUserSharedSettingsServiceTest, Merge) { EXPECT_EQ( 4u, - settings_service_.GetAllSyncData(MANAGED_USER_SHARED_SETTINGS).size()); + settings_service_.GetAllSyncData(SUPERVISED_USER_SHARED_SETTINGS).size()); EXPECT_EQ(ToJson(&name), ToJson(settings_service_.GetValue(kIdA, "name"))); EXPECT_EQ(ToJson(&age), ToJson(settings_service_.GetValue(kIdA, "age"))); @@ -260,7 +260,7 @@ TEST_F(ManagedUserSharedSettingsServiceTest, ProcessChanges) { EXPECT_EQ( 4u, - settings_service_.GetAllSyncData(MANAGED_USER_SHARED_SETTINGS).size()); + settings_service_.GetAllSyncData(SUPERVISED_USER_SHARED_SETTINGS).size()); EXPECT_EQ(ToJson(&name), ToJson(settings_service_.GetValue(kIdA, "name"))); EXPECT_EQ(ToJson(&age), ToJson(settings_service_.GetValue(kIdA, "age"))); diff --git a/chrome/browser/managed_mode/managed_user_sync_service.cc b/chrome/browser/managed_mode/managed_user_sync_service.cc index 76e52f9..d41582a 100644 --- a/chrome/browser/managed_mode/managed_user_sync_service.cc +++ b/chrome/browser/managed_mode/managed_user_sync_service.cc @@ -26,7 +26,7 @@ using base::DictionaryValue; using user_prefs::PrefRegistrySyncable; -using syncer::MANAGED_USERS; +using syncer::SUPERVISED_USERS; using syncer::ModelType; using syncer::SyncChange; using syncer::SyncChangeList; @@ -135,7 +135,7 @@ ManagedUserSyncService::~ManagedUserSyncService() { // static void ManagedUserSyncService::RegisterProfilePrefs( PrefRegistrySyncable* registry) { - registry->RegisterDictionaryPref(prefs::kManagedUsers, + registry->RegisterDictionaryPref(prefs::kSupervisedUsers, PrefRegistrySyncable::UNSYNCABLE_PREF); } @@ -266,7 +266,7 @@ void ManagedUserSyncService::UpdateManagedUserImpl( const std::string& encryption_key, int avatar_index, bool add_user) { - DictionaryPrefUpdate update(prefs_, prefs::kManagedUsers); + DictionaryPrefUpdate update(prefs_, prefs::kSupervisedUsers); base::DictionaryValue* dict = update.Get(); scoped_ptr<base::DictionaryValue> value = CreateDictionary( name, master_key, signature_key, encryption_key, avatar_index); @@ -290,7 +290,7 @@ void ManagedUserSyncService::UpdateManagedUserImpl( } void ManagedUserSyncService::DeleteManagedUser(const std::string& id) { - DictionaryPrefUpdate update(prefs_, prefs::kManagedUsers); + DictionaryPrefUpdate update(prefs_, prefs::kSupervisedUsers); bool success = update->RemoveWithoutPathExpansion(id, NULL); DCHECK(success); @@ -301,7 +301,7 @@ void ManagedUserSyncService::DeleteManagedUser(const std::string& id) { change_list.push_back(SyncChange( FROM_HERE, SyncChange::ACTION_DELETE, - SyncData::CreateLocalDelete(id, MANAGED_USERS))); + SyncData::CreateLocalDelete(id, SUPERVISED_USERS))); SyncError sync_error = sync_processor_->ProcessSyncChanges(FROM_HERE, change_list); DCHECK(!sync_error.IsSet()); @@ -309,13 +309,13 @@ void ManagedUserSyncService::DeleteManagedUser(const std::string& id) { const base::DictionaryValue* ManagedUserSyncService::GetManagedUsers() { DCHECK(sync_processor_); - return prefs_->GetDictionary(prefs::kManagedUsers); + return prefs_->GetDictionary(prefs::kSupervisedUsers); } bool ManagedUserSyncService::UpdateManagedUserAvatarIfNeeded( const std::string& id, int avatar_index) { - DictionaryPrefUpdate update(prefs_, prefs::kManagedUsers); + DictionaryPrefUpdate update(prefs_, prefs::kSupervisedUsers); base::DictionaryValue* dict = update.Get(); DCHECK(dict->HasKey(id)); base::DictionaryValue* value = NULL; @@ -398,14 +398,14 @@ SyncMergeResult ManagedUserSyncService::MergeDataAndStartSyncing( const SyncDataList& initial_sync_data, scoped_ptr<SyncChangeProcessor> sync_processor, scoped_ptr<SyncErrorFactory> error_handler) { - DCHECK_EQ(MANAGED_USERS, type); + DCHECK_EQ(SUPERVISED_USERS, type); sync_processor_ = sync_processor.Pass(); error_handler_ = error_handler.Pass(); SyncChangeList change_list; - SyncMergeResult result(MANAGED_USERS); + SyncMergeResult result(SUPERVISED_USERS); - DictionaryPrefUpdate update(prefs_, prefs::kManagedUsers); + DictionaryPrefUpdate update(prefs_, prefs::kSupervisedUsers); base::DictionaryValue* dict = update.Get(); result.set_num_items_before_association(dict->size()); std::set<std::string> seen_ids; @@ -413,7 +413,7 @@ SyncMergeResult ManagedUserSyncService::MergeDataAndStartSyncing( int num_items_modified = 0; for (SyncDataList::const_iterator it = initial_sync_data.begin(); it != initial_sync_data.end(); ++it) { - DCHECK_EQ(MANAGED_USERS, it->GetDataType()); + DCHECK_EQ(SUPERVISED_USERS, it->GetDataType()); const ManagedUserSpecifics& managed_user = it->GetSpecifics().managed_user(); base::DictionaryValue* value = new base::DictionaryValue(); @@ -455,7 +455,7 @@ SyncMergeResult ManagedUserSyncService::MergeDataAndStartSyncing( } void ManagedUserSyncService::StopSyncing(ModelType type) { - DCHECK_EQ(MANAGED_USERS, type); + DCHECK_EQ(SUPERVISED_USERS, type); // The observers may want to change the Sync data, so notify them before // resetting the |sync_processor_|. NotifyManagedUsersSyncingStopped(); @@ -466,7 +466,7 @@ void ManagedUserSyncService::StopSyncing(ModelType type) { SyncDataList ManagedUserSyncService::GetAllSyncData( ModelType type) const { SyncDataList data; - DictionaryPrefUpdate update(prefs_, prefs::kManagedUsers); + DictionaryPrefUpdate update(prefs_, prefs::kSupervisedUsers); base::DictionaryValue* dict = update.Get(); for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) data.push_back(CreateSyncDataFromDictionaryEntry(it.key(), it.value())); @@ -478,12 +478,12 @@ SyncError ManagedUserSyncService::ProcessSyncChanges( const tracked_objects::Location& from_here, const SyncChangeList& change_list) { SyncError error; - DictionaryPrefUpdate update(prefs_, prefs::kManagedUsers); + DictionaryPrefUpdate update(prefs_, prefs::kSupervisedUsers); base::DictionaryValue* dict = update.Get(); for (SyncChangeList::const_iterator it = change_list.begin(); it != change_list.end(); ++it) { SyncData data = it->sync_data(); - DCHECK_EQ(MANAGED_USERS, data.GetDataType()); + DCHECK_EQ(SUPERVISED_USERS, data.GetDataType()); const ManagedUserSpecifics& managed_user = data.GetSpecifics().managed_user(); switch (it->change_type()) { @@ -539,7 +539,7 @@ void ManagedUserSyncService::OnLastSignedInUsernameChange() { // If the last signed in user changes, we clear all data, to avoid managed // users from one custodian appearing in another one's profile. - prefs_->ClearPref(prefs::kManagedUsers); + prefs_->ClearPref(prefs::kSupervisedUsers); } void ManagedUserSyncService::NotifyManagedUserAcknowledged( @@ -561,7 +561,7 @@ void ManagedUserSyncService::NotifyManagedUsersChanged() { void ManagedUserSyncService::DispatchCallbacks() { const base::DictionaryValue* managed_users = - prefs_->GetDictionary(prefs::kManagedUsers); + prefs_->GetDictionary(prefs::kSupervisedUsers); for (std::vector<ManagedUsersCallback>::iterator it = callbacks_.begin(); it != callbacks_.end(); ++it) { it->Run(managed_users); diff --git a/chrome/browser/managed_mode/managed_user_sync_service_unittest.cc b/chrome/browser/managed_mode/managed_user_sync_service_unittest.cc index 999159a..f59eea6 100644 --- a/chrome/browser/managed_mode/managed_user_sync_service_unittest.cc +++ b/chrome/browser/managed_mode/managed_user_sync_service_unittest.cc @@ -26,7 +26,7 @@ #endif using sync_pb::ManagedUserSpecifics; -using syncer::MANAGED_USERS; +using syncer::SUPERVISED_USERS; using syncer::SyncChange; using syncer::SyncChangeList; using syncer::SyncChangeProcessor; @@ -153,7 +153,7 @@ SyncData ManagedUserSyncServiceTest::CreateRemoteData( TEST_F(ManagedUserSyncServiceTest, MergeEmpty) { SyncMergeResult result = - service()->MergeDataAndStartSyncing(MANAGED_USERS, + service()->MergeDataAndStartSyncing(SUPERVISED_USERS, SyncDataList(), CreateChangeProcessor(), CreateErrorFactory()); @@ -166,7 +166,7 @@ TEST_F(ManagedUserSyncServiceTest, MergeEmpty) { EXPECT_EQ(0u, service()->GetManagedUsers()->size()); EXPECT_EQ(0u, change_processor()->changes().size()); - service()->StopSyncing(MANAGED_USERS); + service()->StopSyncing(SUPERVISED_USERS); service()->Shutdown(); } @@ -193,7 +193,7 @@ TEST_F(ManagedUserSyncServiceTest, MergeExisting) { #endif const char kAvatar4[] = ""; { - DictionaryPrefUpdate update(prefs(), prefs::kManagedUsers); + DictionaryPrefUpdate update(prefs(), prefs::kSupervisedUsers); base::DictionaryValue* managed_users = update.Get(); base::DictionaryValue* dict = new base::DictionaryValue; dict->SetString(kNameKey, kName1); @@ -214,7 +214,7 @@ TEST_F(ManagedUserSyncServiceTest, MergeExisting) { initial_sync_data.push_back(CreateRemoteData(kUserId4, kName4, kAvatar4)); SyncMergeResult result = - service()->MergeDataAndStartSyncing(MANAGED_USERS, + service()->MergeDataAndStartSyncing(SUPERVISED_USERS, initial_sync_data, CreateChangeProcessor(), CreateErrorFactory()); diff --git a/chrome/browser/managed_mode/managed_user_theme.cc b/chrome/browser/managed_mode/managed_user_theme.cc index 6431728..42ee844 100644 --- a/chrome/browser/managed_mode/managed_user_theme.cc +++ b/chrome/browser/managed_mode/managed_user_theme.cc @@ -43,7 +43,7 @@ int MapToManagedUserResourceIds(int id) { } // namespace ManagedUserTheme::ManagedUserTheme() - : CustomThemeSupplier(MANAGED_USER_THEME) {} + : CustomThemeSupplier(SUPERVISED_USER_THEME) {} ManagedUserTheme::~ManagedUserTheme() {} @@ -55,10 +55,10 @@ bool ManagedUserTheme::GetColor(int id, SkColor* color) const { case ThemeProperties::COLOR_FRAME_INACTIVE: *color = kDefaultColorFrameManagedUserInactive; return true; - case ThemeProperties::COLOR_MANAGED_USER_LABEL: + case ThemeProperties::COLOR_SUPERVISED_USER_LABEL: *color = SK_ColorWHITE; return true; - case ThemeProperties::COLOR_MANAGED_USER_LABEL_BACKGROUND: + case ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND: *color = kDefaultColorManagedUserLabelBackground; return true; } diff --git a/chrome/browser/managed_mode/supervised_user_pref_mapping_service.cc b/chrome/browser/managed_mode/supervised_user_pref_mapping_service.cc index 69278c4..dce8165 100644 --- a/chrome/browser/managed_mode/supervised_user_pref_mapping_service.cc +++ b/chrome/browser/managed_mode/supervised_user_pref_mapping_service.cc @@ -18,7 +18,7 @@ SupervisedUserPrefMappingService::SupervisedUserPrefMappingService( ManagedUserSharedSettingsService* shared_settings) : prefs_(prefs), shared_settings_(shared_settings), - managed_user_id_(prefs->GetString(prefs::kManagedUserId)), + managed_user_id_(prefs->GetString(prefs::kSupervisedUserId)), weak_ptr_factory_(this) {} SupervisedUserPrefMappingService::~SupervisedUserPrefMappingService() {} diff --git a/chrome/browser/managed_mode/supervised_user_pref_mapping_service_unittest.cc b/chrome/browser/managed_mode/supervised_user_pref_mapping_service_unittest.cc index 7909ca3..88e836f 100644 --- a/chrome/browser/managed_mode/supervised_user_pref_mapping_service_unittest.cc +++ b/chrome/browser/managed_mode/supervised_user_pref_mapping_service_unittest.cc @@ -14,12 +14,13 @@ #include "chrome/test/base/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" -const char kFakeManagedUserId[] = "fakeID"; +const char kFakeSupervisedUserId[] = "fakeID"; class SupervisedUserPrefMappingServiceTest : public ::testing::Test { protected: SupervisedUserPrefMappingServiceTest() { - profile_.GetPrefs()->SetString(prefs::kManagedUserId, kFakeManagedUserId); + profile_.GetPrefs()->SetString(prefs::kSupervisedUserId, + kFakeSupervisedUserId); shared_settings_service_ = ManagedUserSharedSettingsServiceFactory::GetForBrowserContext( &profile_); @@ -46,11 +47,11 @@ class SupervisedUserPrefMappingServiceTest : public ::testing::Test { TEST_F(SupervisedUserPrefMappingServiceTest, CheckPrefUpdate) { EXPECT_TRUE(shared_settings_service_->GetValue( - kFakeManagedUserId, managed_users::kChromeAvatarIndex) == + kFakeSupervisedUserId, managed_users::kChromeAvatarIndex) == NULL); profile_.GetPrefs()->SetInteger(prefs::kProfileAvatarIndex, 4); const base::Value* value = shared_settings_service_->GetValue( - kFakeManagedUserId, managed_users::kChromeAvatarIndex); + kFakeSupervisedUserId, managed_users::kChromeAvatarIndex); int avatar_index; value->GetAsInteger(&avatar_index); EXPECT_EQ(avatar_index, 4); @@ -58,10 +59,10 @@ TEST_F(SupervisedUserPrefMappingServiceTest, CheckPrefUpdate) { TEST_F(SupervisedUserPrefMappingServiceTest, CheckSharedSettingUpdate) { EXPECT_EQ(profile_.GetPrefs()->GetInteger(prefs::kProfileAvatarIndex), -1); - shared_settings_service_->SetValue(kFakeManagedUserId, + shared_settings_service_->SetValue(kFakeSupervisedUserId, managed_users::kChromeAvatarIndex, base::FundamentalValue(1)); - mapping_service_->OnSharedSettingChanged(kFakeManagedUserId, + mapping_service_->OnSharedSettingChanged(kFakeSupervisedUserId, managed_users::kChromeAvatarIndex); EXPECT_EQ(profile_.GetPrefs()->GetInteger(prefs::kProfileAvatarIndex), 1); } diff --git a/chrome/browser/managed_mode/supervised_user_pref_store.cc b/chrome/browser/managed_mode/supervised_user_pref_store.cc index 8d9dd27..ceaeec2 100644 --- a/chrome/browser/managed_mode/supervised_user_pref_store.cc +++ b/chrome/browser/managed_mode/supervised_user_pref_store.cc @@ -25,15 +25,15 @@ struct ManagedUserSettingsPrefMappingEntry { ManagedUserSettingsPrefMappingEntry kManagedUserSettingsPrefMapping[] = { { managed_users::kContentPackDefaultFilteringBehavior, - prefs::kDefaultManagedModeFilteringBehavior, + prefs::kDefaultSupervisedUserFilteringBehavior, }, { managed_users::kContentPackManualBehaviorHosts, - prefs::kManagedModeManualHosts, + prefs::kSupervisedUserManualHosts, }, { managed_users::kContentPackManualBehaviorURLs, - prefs::kManagedModeManualURLs, + prefs::kSupervisedUserManualURLs, }, { managed_users::kForceSafeSearch, @@ -92,7 +92,7 @@ void SupervisedUserPrefStore::OnNewSettingsAvailable( // Set hardcoded prefs. prefs_->SetValue(prefs::kAllowDeletingBrowserHistory, new FundamentalValue(false)); - prefs_->SetValue(prefs::kDefaultManagedModeFilteringBehavior, + prefs_->SetValue(prefs::kDefaultSupervisedUserFilteringBehavior, new FundamentalValue(ManagedModeURLFilter::ALLOW)); prefs_->SetValue(prefs::kForceSafeSearch, new FundamentalValue(true)); prefs_->SetValue(prefs::kHideWebStoreIcon, new FundamentalValue(true)); diff --git a/chrome/browser/managed_mode/supervised_user_pref_store_unittest.cc b/chrome/browser/managed_mode/supervised_user_pref_store_unittest.cc index 74ba384c..4028b9d 100644 --- a/chrome/browser/managed_mode/supervised_user_pref_store_unittest.cc +++ b/chrome/browser/managed_mode/supervised_user_pref_store_unittest.cc @@ -110,7 +110,7 @@ TEST_F(SupervisedUserPrefStoreTest, ConfigureSettings) { // kManagedModeManualHosts does not have a hardcoded value. base::DictionaryValue* manual_hosts = NULL; EXPECT_FALSE(fixture.changed_prefs()->GetDictionary( - prefs::kManagedModeManualHosts, &manual_hosts)); + prefs::kSupervisedUserManualHosts, &manual_hosts)); // kForceSafeSearch defaults to true for managed users. bool force_safesearch = false; @@ -132,7 +132,7 @@ TEST_F(SupervisedUserPrefStoreTest, ConfigureSettings) { scoped_ptr<base::Value>(dict->DeepCopy())); EXPECT_EQ(1u, fixture.changed_prefs()->size()); ASSERT_TRUE(fixture.changed_prefs()->GetDictionary( - prefs::kManagedModeManualHosts, &manual_hosts)); + prefs::kSupervisedUserManualHosts, &manual_hosts)); EXPECT_TRUE(manual_hosts->Equals(dict.get())); // kForceSafeSearch can be configured by the custodian, overriding the diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 6528aea..7ecff28b 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc @@ -360,7 +360,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { prefs::kVariationsRestrictParameter, base::Value::TYPE_STRING }, { key::kSupervisedUserCreationEnabled, - prefs::kManagedUserCreationAllowed, + prefs::kSupervisedUserCreationAllowed, base::Value::TYPE_BOOLEAN }, { key::kForceEphemeralProfiles, prefs::kForceEphemeralProfiles, diff --git a/chrome/browser/profiles/avatar_menu.cc b/chrome/browser/profiles/avatar_menu.cc index c8dad05..209dda2 100644 --- a/chrome/browser/profiles/avatar_menu.cc +++ b/chrome/browser/profiles/avatar_menu.cc @@ -185,9 +185,9 @@ size_t AvatarMenu::GetActiveProfileIndex() { return index; } -base::string16 AvatarMenu::GetManagedUserInformation() const { +base::string16 AvatarMenu::GetSupervisedUserInformation() const { // |browser_| can be NULL in unit_tests. - if (browser_ && browser_->profile()->IsManaged()) { + if (browser_ && browser_->profile()->IsSupervised()) { #if defined(ENABLE_MANAGED_USERS) ManagedUserService* service = ManagedUserServiceFactory::GetForProfile( browser_->profile()); @@ -199,7 +199,7 @@ base::string16 AvatarMenu::GetManagedUserInformation() const { return base::string16(); } -const gfx::Image& AvatarMenu::GetManagedUserIcon() const { +const gfx::Image& AvatarMenu::GetSupervisedUserIcon() const { return ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_MANAGED_USER_ICON); } diff --git a/chrome/browser/profiles/avatar_menu.h b/chrome/browser/profiles/avatar_menu.h index 6679741..c58de8d 100644 --- a/chrome/browser/profiles/avatar_menu.h +++ b/chrome/browser/profiles/avatar_menu.h @@ -57,9 +57,9 @@ class AvatarMenu : public content::NotificationObserver { // Whether or not the current profile requires sign-in before use. bool signin_required; - // Whether or not the current profile is a managed user + // Whether or not the current profile is a supervised user // (see ManagedUserService). - bool managed; + bool supervised; // The index in the menu of this profile, used by views to refer to // profiles. @@ -117,14 +117,14 @@ class AvatarMenu : public content::NotificationObserver { // Returns the index of the active profile. size_t GetActiveProfileIndex(); - // Returns information about a managed user which will be displayed in the - // avatar menu. If the profile does not belong to a managed user, an empty + // Returns information about a supervised user which will be displayed in the + // avatar menu. If the profile does not belong to a supervised user, an empty // string will be returned. - base::string16 GetManagedUserInformation() const; + base::string16 GetSupervisedUserInformation() const; - // Returns the icon for the managed user which will be displayed in the + // Returns the icon for the supervised user which will be displayed in the // avatar menu. - const gfx::Image& GetManagedUserIcon() const; + const gfx::Image& GetSupervisedUserIcon() const; // This menu is also used for the always-present Mac system menubar. If the // last active browser changes, the menu will need to reference that browser. diff --git a/chrome/browser/profiles/avatar_menu_actions_desktop.cc b/chrome/browser/profiles/avatar_menu_actions_desktop.cc index 7664b61..ba8b94b 100644 --- a/chrome/browser/profiles/avatar_menu_actions_desktop.cc +++ b/chrome/browser/profiles/avatar_menu_actions_desktop.cc @@ -62,7 +62,7 @@ void AvatarMenuActionsDesktop::EditProfile(Profile* profile, size_t index) { bool AvatarMenuActionsDesktop::ShouldShowAddNewProfileLink() const { // |browser_| can be NULL in unit_tests. - if (browser_ && browser_->profile()->IsManaged()) + if (browser_ && browser_->profile()->IsSupervised()) return false; #if defined(OS_WIN) return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH; diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index a6443e3..3f5f445 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc @@ -263,8 +263,8 @@ ExtensionSpecialStoragePolicy* return GetOriginalProfile()->GetExtensionSpecialStoragePolicy(); } -bool OffTheRecordProfileImpl::IsManaged() { - return GetOriginalProfile()->IsManaged(); +bool OffTheRecordProfileImpl::IsSupervised() { + return GetOriginalProfile()->IsSupervised(); } PrefService* OffTheRecordProfileImpl::GetPrefs() { diff --git a/chrome/browser/profiles/off_the_record_profile_impl.h b/chrome/browser/profiles/off_the_record_profile_impl.h index c48bdad..e4a8685 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.h +++ b/chrome/browser/profiles/off_the_record_profile_impl.h @@ -42,7 +42,7 @@ class OffTheRecordProfileImpl : public Profile { virtual void DestroyOffTheRecordProfile() OVERRIDE; virtual bool HasOffTheRecordProfile() OVERRIDE; virtual Profile* GetOriginalProfile() OVERRIDE; - virtual bool IsManaged() OVERRIDE; + virtual bool IsSupervised() OVERRIDE; virtual ExtensionService* GetExtensionService() OVERRIDE; virtual ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() OVERRIDE; diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index a1dd521..1f5b5019 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h @@ -202,8 +202,8 @@ class Profile : public content::BrowserContext { // profile is not incognito. virtual Profile* GetOriginalProfile() = 0; - // Returns whether the profile is managed (see ManagedUserService). - virtual bool IsManaged() = 0; + // Returns whether the profile is supervised (see ManagedUserService). + virtual bool IsSupervised() = 0; // Returns a pointer to the TopSites (thumbnail manager) instance // for this profile. diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 3d5f319..dea1b55 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -336,14 +336,14 @@ void ProfileImpl::RegisterProfilePrefs( prefs::kProfileAvatarIndex, -1, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); - registry->RegisterStringPref(prefs::kManagedUserId, + registry->RegisterStringPref(prefs::kSupervisedUserId, std::string(), user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterStringPref(prefs::kProfileName, std::string(), user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterBooleanPref( - prefs::kProfileIsManaged, + prefs::kProfileIsSupervised, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterStringPref(prefs::kHomePage, @@ -508,8 +508,8 @@ void ProfileImpl::DoFinalInit() { base::Bind(&ProfileImpl::UpdateProfileUserNameCache, base::Unretained(this))); pref_change_registrar_.Add( - prefs::kManagedUserId, - base::Bind(&ProfileImpl::UpdateProfileManagedUserIdCache, + prefs::kSupervisedUserId, + base::Bind(&ProfileImpl::UpdateProfileSupervisedUserIdCache, base::Unretained(this))); pref_change_registrar_.Add( prefs::kDefaultZoomLevel, @@ -542,7 +542,7 @@ void ProfileImpl::DoFinalInit() { // kGoogleServicesUsername, initialize components that depend on it to reflect // the current value. UpdateProfileUserNameCache(); - UpdateProfileManagedUserIdCache(); + UpdateProfileSupervisedUserIdCache(); UpdateProfileIsEphemeralCache(); GAIAInfoUpdateServiceFactory::GetForProfile(this); @@ -801,8 +801,8 @@ Profile* ProfileImpl::GetOriginalProfile() { return this; } -bool ProfileImpl::IsManaged() { - return !GetPrefs()->GetString(prefs::kManagedUserId).empty(); +bool ProfileImpl::IsSupervised() { + return !GetPrefs()->GetString(prefs::kSupervisedUserId).empty(); } ExtensionService* ProfileImpl::GetExtensionService() { @@ -1303,13 +1303,14 @@ void ProfileImpl::UpdateProfileUserNameCache() { } } -void ProfileImpl::UpdateProfileManagedUserIdCache() { +void ProfileImpl::UpdateProfileSupervisedUserIdCache() { ProfileManager* profile_manager = g_browser_process->profile_manager(); ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); size_t index = cache.GetIndexOfProfileWithPath(GetPath()); if (index != std::string::npos) { - std::string managed_user_id = GetPrefs()->GetString(prefs::kManagedUserId); - cache.SetManagedUserIdOfProfileAtIndex(index, managed_user_id); + std::string supervised_user_id = + GetPrefs()->GetString(prefs::kSupervisedUserId); + cache.SetSupervisedUserIdOfProfileAtIndex(index, supervised_user_id); ProfileMetrics::UpdateReportedProfilesStatistics(profile_manager); } } diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h index 3dde834..d0359bf 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h @@ -117,7 +117,7 @@ class ProfileImpl : public Profile { virtual void DestroyOffTheRecordProfile() OVERRIDE; virtual bool HasOffTheRecordProfile() OVERRIDE; virtual Profile* GetOriginalProfile() OVERRIDE; - virtual bool IsManaged() OVERRIDE; + virtual bool IsSupervised() OVERRIDE; virtual history::TopSites* GetTopSites() OVERRIDE; virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; virtual ExtensionService* GetExtensionService() OVERRIDE; @@ -210,7 +210,7 @@ class ProfileImpl : public Profile { // Updates the ProfileInfoCache with data from this profile. void UpdateProfileUserNameCache(); - void UpdateProfileManagedUserIdCache(); + void UpdateProfileSupervisedUserIdCache(); void UpdateProfileNameCache(); void UpdateProfileAvatarCache(); void UpdateProfileIsEphemeralCache(); diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc index e479fee..18919a8 100644 --- a/chrome/browser/profiles/profile_info_cache.cc +++ b/chrome/browser/profiles/profile_info_cache.cc @@ -49,10 +49,10 @@ const char kAuthCredentialsKey[] = "local_auth_credentials"; const char kUseGAIAPictureKey[] = "use_gaia_picture"; const char kBackgroundAppsKey[] = "background_apps"; const char kGAIAPictureFileNameKey[] = "gaia_picture_file_name"; -const char kIsManagedKey[] = "is_managed"; +const char kIsSupervisedKey[] = "is_managed"; const char kIsOmittedFromProfileListKey[] = "is_omitted_from_profile_list"; const char kSigninRequiredKey[] = "signin_required"; -const char kManagedUserId[] = "managed_user_id"; +const char kSupervisedUserId[] = "managed_user_id"; const char kProfileIsEphemeral[] = "is_ephemeral"; const char kActiveTimeKey[] = "active_time"; @@ -178,10 +178,11 @@ ProfileInfoCache::ProfileInfoCache(PrefService* prefs, sorted_keys_.insert(FindPositionForProfile(it.key(), name), it.key()); // TODO(ibraaaa): delete this when 97% of our users are using M31. // http://crbug.com/276163 - bool is_managed = false; - if (info->GetBoolean(kIsManagedKey, &is_managed)) { - info->Remove(kIsManagedKey, NULL); - info->SetString(kManagedUserId, is_managed ? "DUMMY_ID" : std::string()); + bool is_supervised = false; + if (info->GetBoolean(kIsSupervisedKey, &is_supervised)) { + info->Remove(kIsSupervisedKey, NULL); + info->SetString(kSupervisedUserId, + is_supervised ? "DUMMY_ID" : std::string()); } info->SetBoolean(kIsUsingDefaultName, IsDefaultName(name)); } @@ -203,11 +204,12 @@ ProfileInfoCache::~ProfileInfoCache() { avatar_images_downloads_in_progress_.end()); } -void ProfileInfoCache::AddProfileToCache(const base::FilePath& profile_path, - const base::string16& name, - const base::string16& username, - size_t icon_index, - const std::string& managed_user_id) { +void ProfileInfoCache::AddProfileToCache( + const base::FilePath& profile_path, + const base::string16& name, + const base::string16& username, + size_t icon_index, + const std::string& supervised_user_id) { std::string key = CacheKeyFromProfilePath(profile_path); DictionaryPrefUpdate update(prefs_, prefs::kProfileInfoCache); base::DictionaryValue* cache = update.Get(); @@ -219,8 +221,8 @@ void ProfileInfoCache::AddProfileToCache(const base::FilePath& profile_path, profiles::GetDefaultAvatarIconUrl(icon_index)); // Default value for whether background apps are running is false. info->SetBoolean(kBackgroundAppsKey, false); - info->SetString(kManagedUserId, managed_user_id); - info->SetBoolean(kIsOmittedFromProfileListKey, !managed_user_id.empty()); + info->SetString(kSupervisedUserId, supervised_user_id); + info->SetBoolean(kIsOmittedFromProfileListKey, !supervised_user_id.empty()); info->SetBoolean(kProfileIsEphemeral, false); info->SetBoolean(kIsUsingDefaultName, IsDefaultName(name)); cache->SetWithoutPathExpansion(key, info.release()); @@ -405,8 +407,8 @@ bool ProfileInfoCache::IsUsingGAIAPictureOfProfileAtIndex(size_t index) const { return value; } -bool ProfileInfoCache::ProfileIsManagedAtIndex(size_t index) const { - return !GetManagedUserIdOfProfileAtIndex(index).empty(); +bool ProfileInfoCache::ProfileIsSupervisedAtIndex(size_t index) const { + return !GetSupervisedUserIdOfProfileAtIndex(index).empty(); } bool ProfileInfoCache::IsOmittedProfileAtIndex(size_t index) const { @@ -422,11 +424,12 @@ bool ProfileInfoCache::ProfileIsSigninRequiredAtIndex(size_t index) const { return value; } -std::string ProfileInfoCache::GetManagedUserIdOfProfileAtIndex( +std::string ProfileInfoCache::GetSupervisedUserIdOfProfileAtIndex( size_t index) const { - std::string managed_user_id; - GetInfoForProfileAtIndex(index)->GetString(kManagedUserId, &managed_user_id); - return managed_user_id; + std::string supervised_user_id; + GetInfoForProfileAtIndex(index)->GetString(kSupervisedUserId, + &supervised_user_id); + return supervised_user_id; } bool ProfileInfoCache::ProfileIsEphemeralAtIndex(size_t index) const { @@ -541,13 +544,14 @@ void ProfileInfoCache::SetIsOmittedProfileAtIndex(size_t index, SetInfoForProfileAtIndex(index, info.release()); } -void ProfileInfoCache::SetManagedUserIdOfProfileAtIndex(size_t index, - const std::string& id) { - if (GetManagedUserIdOfProfileAtIndex(index) == id) +void ProfileInfoCache::SetSupervisedUserIdOfProfileAtIndex( + size_t index, + const std::string& id) { + if (GetSupervisedUserIdOfProfileAtIndex(index) == id) return; scoped_ptr<base::DictionaryValue> info( GetInfoForProfileAtIndex(index)->DeepCopy()); - info->SetString(kManagedUserId, id); + info->SetString(kSupervisedUserId, id); // This takes ownership of |info|. SetInfoForProfileAtIndex(index, info.release()); } diff --git a/chrome/browser/profiles/profile_info_cache.h b/chrome/browser/profiles/profile_info_cache.h index 341398b..3c1d430 100644 --- a/chrome/browser/profiles/profile_info_cache.h +++ b/chrome/browser/profiles/profile_info_cache.h @@ -39,17 +39,16 @@ class ProfileInfoCache : public ProfileInfoInterface, ProfileInfoCache(PrefService* prefs, const base::FilePath& user_data_dir); virtual ~ProfileInfoCache(); - // This |is_managed| refers to local management (formerly "managed mode"), - // not enterprise management. If the |managed_user_id| is non-empty, the - // profile will be marked to be omitted from the avatar-menu list on desktop - // versions. This is used while a managed user is in the process of being - // registered with the server. Use SetIsOmittedProfileAtIndex() to clear the - // flag when the profile is ready to be shown in the menu. + // If the |supervised_user_id| is non-empty, the profile will be marked to be + // omitted from the avatar-menu list on desktop versions. This is used while a + // supervised user is in the process of being registered with the server. Use + // SetIsOmittedProfileAtIndex() to clear the flag when the profile is ready to + // be shown in the menu. void AddProfileToCache(const base::FilePath& profile_path, const base::string16& name, const base::string16& username, size_t icon_index, - const std::string& managed_user_id); + const std::string& supervised_user_id); void DeleteProfileFromCache(const base::FilePath& profile_path); // ProfileInfoInterface: @@ -85,10 +84,10 @@ class ProfileInfoCache : public ProfileInfoInterface, size_t index) const OVERRIDE; virtual bool IsUsingGAIAPictureOfProfileAtIndex( size_t index) const OVERRIDE; - virtual bool ProfileIsManagedAtIndex(size_t index) const OVERRIDE; + virtual bool ProfileIsSupervisedAtIndex(size_t index) const OVERRIDE; virtual bool IsOmittedProfileAtIndex(size_t index) const OVERRIDE; virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const OVERRIDE; - virtual std::string GetManagedUserIdOfProfileAtIndex(size_t index) const + virtual std::string GetSupervisedUserIdOfProfileAtIndex(size_t index) const OVERRIDE; virtual bool ProfileIsEphemeralAtIndex(size_t index) const OVERRIDE; virtual bool ProfileIsUsingDefaultNameAtIndex(size_t index) const OVERRIDE; @@ -103,7 +102,7 @@ class ProfileInfoCache : public ProfileInfoInterface, const base::string16& user_name); void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); - void SetManagedUserIdOfProfileAtIndex(size_t index, const std::string& id); + void SetSupervisedUserIdOfProfileAtIndex(size_t index, const std::string& id); void SetLocalAuthCredentialsOfProfileAtIndex(size_t index, const std::string& auth); void SetBackgroundStatusOfProfileAtIndex(size_t index, diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc index 1907a22..92638ae 100644 --- a/chrome/browser/profiles/profile_info_cache_unittest.cc +++ b/chrome/browser/profiles/profile_info_cache_unittest.cc @@ -131,10 +131,10 @@ TEST_F(ProfileInfoCacheTest, AddProfiles) { const SkBitmap* icon = rb.GetImageNamed( profiles::GetDefaultAvatarIconResourceIDAtIndex( i)).ToSkBitmap(); - std::string managed_user_id = i == 3 ? "TEST_ID" : ""; + std::string supervised_user_id = i == 3 ? "TEST_ID" : ""; GetCache()->AddProfileToCache(profile_path, profile_name, base::string16(), - i, managed_user_id); + i, supervised_user_id); GetCache()->SetBackgroundStatusOfProfileAtIndex(i, true); base::string16 gaia_name = ASCIIToUTF16(base::StringPrintf("gaia_%ud", i)); GetCache()->SetGAIANameOfProfileAtIndex(i, gaia_name); @@ -146,9 +146,10 @@ TEST_F(ProfileInfoCacheTest, AddProfiles) { GetCache()->GetAvatarIconOfProfileAtIndex(i).ToSkBitmap(); EXPECT_EQ(icon->width(), actual_icon->width()); EXPECT_EQ(icon->height(), actual_icon->height()); - EXPECT_EQ(i == 3, GetCache()->ProfileIsManagedAtIndex(i)); + EXPECT_EQ(i == 3, GetCache()->ProfileIsSupervisedAtIndex(i)); EXPECT_EQ(i == 3, GetCache()->IsOmittedProfileAtIndex(i)); - EXPECT_EQ(managed_user_id, GetCache()->GetManagedUserIdOfProfileAtIndex(i)); + EXPECT_EQ(supervised_user_id, + GetCache()->GetSupervisedUserIdOfProfileAtIndex(i)); } // Reset the cache and test the it reloads correctly. @@ -410,22 +411,22 @@ TEST_F(ProfileInfoCacheTest, PersistGAIAPicture) { gaia_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(0))); } -TEST_F(ProfileInfoCacheTest, SetManagedUserId) { +TEST_F(ProfileInfoCacheTest, SetSupervisedUserId) { GetCache()->AddProfileToCache( GetProfilePath("test"), ASCIIToUTF16("Test"), base::string16(), 0, std::string()); - EXPECT_FALSE(GetCache()->ProfileIsManagedAtIndex(0)); + EXPECT_FALSE(GetCache()->ProfileIsSupervisedAtIndex(0)); - GetCache()->SetManagedUserIdOfProfileAtIndex(0, "TEST_ID"); - EXPECT_TRUE(GetCache()->ProfileIsManagedAtIndex(0)); - EXPECT_EQ("TEST_ID", GetCache()->GetManagedUserIdOfProfileAtIndex(0)); + GetCache()->SetSupervisedUserIdOfProfileAtIndex(0, "TEST_ID"); + EXPECT_TRUE(GetCache()->ProfileIsSupervisedAtIndex(0)); + EXPECT_EQ("TEST_ID", GetCache()->GetSupervisedUserIdOfProfileAtIndex(0)); ResetCache(); - EXPECT_TRUE(GetCache()->ProfileIsManagedAtIndex(0)); + EXPECT_TRUE(GetCache()->ProfileIsSupervisedAtIndex(0)); - GetCache()->SetManagedUserIdOfProfileAtIndex(0, std::string()); - EXPECT_FALSE(GetCache()->ProfileIsManagedAtIndex(0)); - EXPECT_EQ("", GetCache()->GetManagedUserIdOfProfileAtIndex(0)); + GetCache()->SetSupervisedUserIdOfProfileAtIndex(0, std::string()); + EXPECT_FALSE(GetCache()->ProfileIsSupervisedAtIndex(0)); + EXPECT_EQ("", GetCache()->GetSupervisedUserIdOfProfileAtIndex(0)); } TEST_F(ProfileInfoCacheTest, EmptyGAIAInfo) { @@ -449,23 +450,24 @@ TEST_F(ProfileInfoCacheTest, EmptyGAIAInfo) { profile_image, GetCache()->GetAvatarIconOfProfileAtIndex(0))); } -TEST_F(ProfileInfoCacheTest, CreateManagedTestingProfile) { +TEST_F(ProfileInfoCacheTest, CreateSupervisedTestingProfile) { testing_profile_manager_.CreateTestingProfile("default"); - base::string16 managed_user_name = ASCIIToUTF16("Supervised User"); + base::string16 supervised_user_name = ASCIIToUTF16("Supervised User"); testing_profile_manager_.CreateTestingProfile( "test1", scoped_ptr<PrefServiceSyncable>(), - managed_user_name, 0, "TEST_ID", TestingProfile::TestingFactories()); + supervised_user_name, 0, "TEST_ID", TestingProfile::TestingFactories()); for (size_t i = 0; i < GetCache()->GetNumberOfProfiles(); i++) { - bool is_managed = - GetCache()->GetNameOfProfileAtIndex(i) == managed_user_name; - EXPECT_EQ(is_managed, GetCache()->ProfileIsManagedAtIndex(i)); - std::string managed_user_id = is_managed ? "TEST_ID" : ""; - EXPECT_EQ(managed_user_id, GetCache()->GetManagedUserIdOfProfileAtIndex(i)); + bool is_supervised = + GetCache()->GetNameOfProfileAtIndex(i) == supervised_user_name; + EXPECT_EQ(is_supervised, GetCache()->ProfileIsSupervisedAtIndex(i)); + std::string supervised_user_id = is_supervised ? "TEST_ID" : ""; + EXPECT_EQ(supervised_user_id, + GetCache()->GetSupervisedUserIdOfProfileAtIndex(i)); } - // Managed profiles have a custom theme, which needs to be deleted on the FILE - // thread. Reset the profile manager now so everything is deleted while we - // still have a FILE thread. + // Supervised profiles have a custom theme, which needs to be deleted on the + // FILE thread. Reset the profile manager now so everything is deleted while + // we still have a FILE thread. TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL); } diff --git a/chrome/browser/profiles/profile_info_interface.h b/chrome/browser/profiles/profile_info_interface.h index 66f6741..563fb63 100644 --- a/chrome/browser/profiles/profile_info_interface.h +++ b/chrome/browser/profiles/profile_info_interface.h @@ -59,13 +59,14 @@ class ProfileInfoInterface { // Checks if the GAIA picture should be used as the profile's avatar icon. virtual bool IsUsingGAIAPictureOfProfileAtIndex(size_t index) const = 0; - virtual bool ProfileIsManagedAtIndex(size_t index) const = 0; + virtual bool ProfileIsSupervisedAtIndex(size_t index) const = 0; // Returns true if the profile should be omitted from the desktop profile // list (see ProfileListDesktop), so it won't appear in the avatar menu. virtual bool IsOmittedProfileAtIndex(size_t index) const = 0; - virtual std::string GetManagedUserIdOfProfileAtIndex(size_t index) const = 0; + virtual std::string GetSupervisedUserIdOfProfileAtIndex( + size_t index) const = 0; // This profile is associated with an account but has been signed-out. virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const = 0; diff --git a/chrome/browser/profiles/profile_list_desktop.cc b/chrome/browser/profiles/profile_list_desktop.cc index 59ffb78..cf69b3c 100644 --- a/chrome/browser/profiles/profile_list_desktop.cc +++ b/chrome/browser/profiles/profile_list_desktop.cc @@ -51,12 +51,12 @@ void ProfileListDesktop::RebuildMenu() { item->name = profile_info_->GetNameOfProfileAtIndex(i); item->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i); item->profile_path = profile_info_->GetPathOfProfileAtIndex(i); - item->managed = profile_info_->ProfileIsManagedAtIndex(i); + item->supervised = profile_info_->ProfileIsSupervisedAtIndex(i); item->signed_in = !item->sync_state.empty(); if (!item->signed_in) { item->sync_state = l10n_util::GetStringUTF16( - item->managed ? IDS_MANAGED_USER_AVATAR_LABEL : - IDS_PROFILES_LOCAL_PROFILE_STATE); + item->supervised ? IDS_MANAGED_USER_AVATAR_LABEL : + IDS_PROFILES_LOCAL_PROFILE_STATE); } item->active = profile_info_->GetPathOfProfileAtIndex(i) == active_profile_path_; diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index 3634ad4..0396ab2 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc @@ -372,7 +372,7 @@ void ProfileManager::CreateProfileAsync( const CreateCallback& callback, const base::string16& name, const base::string16& icon_url, - const std::string& managed_user_id) { + const std::string& supervised_user_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Make sure that this profile is not pending deletion. @@ -398,10 +398,10 @@ void ProfileManager::CreateProfileAsync( if (profiles::IsDefaultAvatarIconUrl(icon_url_std, &icon_index)) { // add profile to cache with user selected name and avatar cache.AddProfileToCache(profile_path, name, base::string16(), icon_index, - managed_user_id); + supervised_user_id); } - if (!managed_user_id.empty()) { + if (!supervised_user_id.empty()) { content::RecordAction( UserMetricsAction("ManagedMode_LocallyManagedUserCreated")); } @@ -561,7 +561,7 @@ base::FilePath ProfileManager::CreateMultiProfileAsync( const base::string16& name, const base::string16& icon_url, const CreateCallback& callback, - const std::string& managed_user_id) { + const std::string& supervised_user_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); ProfileManager* profile_manager = g_browser_process->profile_manager(); @@ -572,7 +572,7 @@ base::FilePath ProfileManager::CreateMultiProfileAsync( callback, name, icon_url, - managed_user_id); + supervised_user_id); return new_path; } @@ -640,22 +640,22 @@ void ProfileManager::ScheduleProfileForDeletion( local_state->GetString(prefs::kProfileLastUsed)) { // Update the last used profile pref before closing browser windows. This // way the correct last used profile is set for any notification observers. - base::FilePath last_non_managed_profile_path; + base::FilePath last_non_supervised_profile_path; for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { base::FilePath cur_path = cache.GetPathOfProfileAtIndex(i); // Make sure that this profile is not pending deletion. - if (cur_path != profile_dir && !cache.ProfileIsManagedAtIndex(i) && + if (cur_path != profile_dir && !cache.ProfileIsSupervisedAtIndex(i) && !IsProfileMarkedForDeletion(cur_path)) { - last_non_managed_profile_path = cur_path; + last_non_supervised_profile_path = cur_path; break; } } - // If we're deleting the last (non-managed) profile, then create a new + // If we're deleting the last (non-supervised) profile, then create a new // profile in its place. - const std::string last_non_managed_profile = - last_non_managed_profile_path.BaseName().MaybeAsASCII(); - if (last_non_managed_profile.empty()) { + const std::string last_non_supervised_profile = + last_non_supervised_profile_path.BaseName().MaybeAsASCII(); + if (last_non_supervised_profile.empty()) { base::FilePath new_path = GenerateNextProfileDirectoryPath(); // Make sure the last used profile path is pointing at it. This way the // correct last used profile is set for any notification observers. @@ -671,11 +671,11 @@ void ProfileManager::ScheduleProfileForDeletion( // are closed, so just in case we are deleting the active profile, and no // other profile has been loaded, we must pre-load a next one. #if defined(OS_MACOSX) - CreateProfileAsync(last_non_managed_profile_path, + CreateProfileAsync(last_non_supervised_profile_path, base::Bind(&ProfileManager::OnNewActiveProfileLoaded, base::Unretained(this), profile_dir, - last_non_managed_profile_path, + last_non_supervised_profile_path, callback), base::string16(), base::string16(), @@ -684,7 +684,8 @@ void ProfileManager::ScheduleProfileForDeletion( #else // For OS_MACOSX the pref is updated in the callback to make sure that // it isn't used before the profile is actually loaded. - local_state->SetString(prefs::kProfileLastUsed, last_non_managed_profile); + local_state->SetString(prefs::kProfileLastUsed, + last_non_supervised_profile); #endif } } @@ -731,7 +732,7 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { size_t avatar_index; std::string profile_name; - std::string managed_user_id; + std::string supervised_user_id; if (profile->IsGuestSession()) { profile_name = l10n_util::GetStringUTF8(IDS_PROFILES_GUEST_PROFILE_NAME); avatar_index = 0; @@ -744,8 +745,8 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { cache.GetAvatarIconIndexOfProfileAtIndex(profile_cache_index); profile_name = base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_cache_index)); - managed_user_id = - cache.GetManagedUserIdOfProfileAtIndex(profile_cache_index); + supervised_user_id = + cache.GetSupervisedUserIdOfProfileAtIndex(profile_cache_index); } else if (profile->GetPath() == profiles::GetDefaultProfileDir(cache.GetUserDataDir())) { avatar_index = 0; @@ -767,15 +768,16 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) { profile->GetPrefs()->SetString(prefs::kProfileName, profile_name); CommandLine* command_line = CommandLine::ForCurrentProcess(); - bool force_managed_user_id = - command_line->HasSwitch(switches::kManagedUserId); - if (force_managed_user_id) { - managed_user_id = - command_line->GetSwitchValueASCII(switches::kManagedUserId); + bool force_supervised_user_id = + command_line->HasSwitch(switches::kSupervisedUserId); + if (force_supervised_user_id) { + supervised_user_id = + command_line->GetSwitchValueASCII(switches::kSupervisedUserId); } - if (force_managed_user_id || - !profile->GetPrefs()->HasPrefPath(prefs::kManagedUserId)) { - profile->GetPrefs()->SetString(prefs::kManagedUserId, managed_user_id); + if (force_supervised_user_id || + !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { + profile->GetPrefs()->SetString(prefs::kSupervisedUserId, + supervised_user_id); } } @@ -974,7 +976,7 @@ void ProfileManager::DoFinalInitForServices(Profile* profile, #if defined(ENABLE_MANAGED_USERS) // Initialization needs to happen after extension system initialization (for // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the - // initializing the managed flag if necessary). + // initializing the supervised flag if necessary). ManagedUserServiceFactory::GetForProfile(profile)->Init(); #endif // Start the deferred task runners once the profile is loaded. @@ -1133,14 +1135,14 @@ void ProfileManager::AddProfileToCache(Profile* profile) { size_t icon_index = profile->GetPrefs()->GetInteger( prefs::kProfileAvatarIndex); - std::string managed_user_id = - profile->GetPrefs()->GetString(prefs::kManagedUserId); + std::string supervised_user_id = + profile->GetPrefs()->GetString(prefs::kSupervisedUserId); cache.AddProfileToCache(profile->GetPath(), profile_name, username, icon_index, - managed_user_id); + supervised_user_id); if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) { cache.SetProfileIsEphemeralAtIndex( @@ -1258,7 +1260,7 @@ void ProfileManager::BrowserListObserver::OnBrowserSetLastActive( #if defined(OS_MACOSX) void ProfileManager::OnNewActiveProfileLoaded( const base::FilePath& profile_to_delete_path, - const base::FilePath& last_non_managed_profile_path, + const base::FilePath& last_non_supervised_profile_path, const CreateCallback& original_callback, Profile* loaded_profile, Profile::CreateStatus status) { @@ -1267,7 +1269,7 @@ void ProfileManager::OnNewActiveProfileLoaded( // Only run the code if the profile initialization has finished completely. if (status == Profile::CREATE_STATUS_INITIALIZED) { - if (IsProfileMarkedForDeletion(last_non_managed_profile_path)) { + if (IsProfileMarkedForDeletion(last_non_supervised_profile_path)) { // If the profile we tried to load as the next active profile has been // deleted, then retry deleting this profile to redo the logic to load // the next available profile. @@ -1276,7 +1278,7 @@ void ProfileManager::OnNewActiveProfileLoaded( // Update the local state as promised in the ScheduleProfileForDeletion. g_browser_process->local_state()->SetString( prefs::kProfileLastUsed, - last_non_managed_profile_path.BaseName().MaybeAsASCII()); + last_non_supervised_profile_path.BaseName().MaybeAsASCII()); FinishDeletingProfile(profile_to_delete_path); } } diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h index d71c1d7..02334bf 100644 --- a/chrome/browser/profiles/profile_manager.h +++ b/chrome/browser/profiles/profile_manager.h @@ -86,7 +86,7 @@ class ProfileManager : public base::NonThreadSafe, const CreateCallback& callback, const base::string16& name, const base::string16& icon_url, - const std::string& managed_user_id); + const std::string& supervised_user_id); // Returns true if the profile pointer is known to point to an existing // profile. @@ -134,7 +134,7 @@ class ProfileManager : public base::NonThreadSafe, const base::string16& name, const base::string16& icon_url, const CreateCallback& callback, - const std::string& managed_user_id); + const std::string& supervised_user_id); // Returns the full path to be used for guest profiles. static base::FilePath GetGuestProfilePath(); @@ -298,10 +298,11 @@ class ProfileManager : public base::NonThreadSafe, // If the |loaded_profile| has been loaded successfully (according to // |status|) and isn't already scheduled for deletion, then finishes adding // |profile_to_delete_dir| to the queue of profiles to be deleted, and updates - // the kProfileLastUsed preference based on |last_non_managed_profile_path|. + // the kProfileLastUsed preference based on + // |last_non_supervised_profile_path|. void OnNewActiveProfileLoaded( const base::FilePath& profile_to_delete_path, - const base::FilePath& last_non_managed_profile_path, + const base::FilePath& last_non_supervised_profile_path, const CreateCallback& original_callback, Profile* loaded_profile, Profile::CreateStatus status); diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc index a0f1660..50e2760 100644 --- a/chrome/browser/profiles/profile_manager_unittest.cc +++ b/chrome/browser/profiles/profile_manager_unittest.cc @@ -120,7 +120,7 @@ class ProfileManagerTest : public testing::Test { // Helper function to create a profile with |name| for a profile |manager|. void CreateProfileAsync(ProfileManager* manager, const std::string& name, - bool is_managed, + bool is_supervised, MockObserver* mock_observer) { manager->CreateProfileAsync( temp_dir_.path().AppendASCII(name), @@ -128,7 +128,7 @@ class ProfileManagerTest : public testing::Test { base::Unretained(mock_observer)), base::UTF8ToUTF16(name), base::UTF8ToUTF16(profiles::GetDefaultAvatarIconUrl(0)), - is_managed ? "Dummy ID" : std::string()); + is_supervised ? "Dummy ID" : std::string()); } // Helper function to add a profile with |profile_name| to @@ -302,7 +302,7 @@ TEST_F(ProfileManagerTest, CreateProfilesAsync) { } TEST_F(ProfileManagerTest, CreateProfileAsyncCheckOmitted) { - std::string name = "Managed Profile"; + std::string name = "0 Supervised Profile"; MockObserver mock_observer; EXPECT_CALL(mock_observer, OnProfileCreated( @@ -316,15 +316,15 @@ TEST_F(ProfileManagerTest, CreateProfileAsyncCheckOmitted) { base::RunLoop().RunUntilIdle(); EXPECT_EQ(1u, cache.GetNumberOfProfiles()); - // Managed profiles should start out omitted from the profile list. + // Supervised profiles should start out omitted from the profile list. EXPECT_TRUE(cache.IsOmittedProfileAtIndex(0)); - name = "Regular Profile"; + name = "1 Regular Profile"; CreateProfileAsync(profile_manager, name, false, &mock_observer); base::RunLoop().RunUntilIdle(); EXPECT_EQ(2u, cache.GetNumberOfProfiles()); - // Non-managed profiles should be included in the profile list. + // Non-supervised profiles should be included in the profile list. EXPECT_FALSE(cache.IsOmittedProfileAtIndex(1)); } @@ -333,26 +333,29 @@ TEST_F(ProfileManagerTest, AddProfileToCacheCheckOmitted) { ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); EXPECT_EQ(0u, cache.GetNumberOfProfiles()); - const base::FilePath managed_path = temp_dir_.path().AppendASCII("Managed"); - TestingProfile* managed_profile = new TestingProfile(managed_path, NULL); - managed_profile->GetPrefs()->SetString(prefs::kManagedUserId, "An ID"); + const base::FilePath supervised_path = + temp_dir_.path().AppendASCII("Supervised"); + TestingProfile* supervised_profile = + new TestingProfile(supervised_path, NULL); + supervised_profile->GetPrefs()->SetString(prefs::kSupervisedUserId, "An ID"); // RegisterTestingProfile adds the profile to the cache and takes ownership. - profile_manager->RegisterTestingProfile(managed_profile, true, false); + profile_manager->RegisterTestingProfile(supervised_profile, true, false); EXPECT_EQ(1u, cache.GetNumberOfProfiles()); EXPECT_TRUE(cache.IsOmittedProfileAtIndex(0)); - const base::FilePath nonmanaged_path = temp_dir_.path().AppendASCII( - "Non-Managed"); - TestingProfile* nonmanaged_profile = new TestingProfile(nonmanaged_path, - NULL); - profile_manager->RegisterTestingProfile(nonmanaged_profile, true, false); + const base::FilePath nonsupervised_path = temp_dir_.path().AppendASCII( + "Non-Supervised"); + TestingProfile* nonsupervised_profile = new TestingProfile(nonsupervised_path, + NULL); + profile_manager->RegisterTestingProfile(nonsupervised_profile, true, false); EXPECT_EQ(2u, cache.GetNumberOfProfiles()); - size_t managed_index = cache.GetIndexOfProfileWithPath(managed_path); - EXPECT_TRUE(cache.IsOmittedProfileAtIndex(managed_index)); - size_t nonmanaged_index = cache.GetIndexOfProfileWithPath(nonmanaged_path); - EXPECT_FALSE(cache.IsOmittedProfileAtIndex(nonmanaged_index)); + size_t supervised_index = cache.GetIndexOfProfileWithPath(supervised_path); + EXPECT_TRUE(cache.IsOmittedProfileAtIndex(supervised_index)); + size_t nonsupervised_index = + cache.GetIndexOfProfileWithPath(nonsupervised_path); + EXPECT_FALSE(cache.IsOmittedProfileAtIndex(nonsupervised_index)); } TEST_F(ProfileManagerTest, GetGuestProfilePath) { diff --git a/chrome/browser/profiles/profile_metrics.cc b/chrome/browser/profiles/profile_metrics.cc index 6dd3555..b68ad00 100644 --- a/chrome/browser/profiles/profile_metrics.cc +++ b/chrome/browser/profiles/profile_metrics.cc @@ -25,12 +25,12 @@ const int kMaximumDaysOfDisuse = 4 * 7; // Should be integral number of weeks. struct ProfileCounts { size_t total; size_t signedin; - size_t managed; + size_t supervised; size_t unused; size_t gaia_icon; ProfileCounts() - : total(0), signedin(0), managed(0), unused(0), gaia_icon(0) {} + : total(0), signedin(0), supervised(0), unused(0), gaia_icon(0) {} }; ProfileMetrics::ProfileType GetProfileType( @@ -72,8 +72,8 @@ bool CountProfileInformation(ProfileManager* manager, ProfileCounts* counts) { if (info_cache.GetProfileActiveTimeAtIndex(i) < oldest) { counts->unused++; } else { - if (info_cache.ProfileIsManagedAtIndex(i)) - counts->managed++; + if (info_cache.ProfileIsSupervisedAtIndex(i)) + counts->supervised++; if (!info_cache.GetUserNameOfProfileAtIndex(i).empty()) { counts->signedin++; if (info_cache.IsUsingGAIAPictureOfProfileAtIndex(i)) @@ -142,9 +142,9 @@ void ProfileMetrics::LogNumberOfProfiles(ProfileManager* manager) { // Ignore other metrics if we have no profiles, e.g. in Chrome Frame tests. if (success) { UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfManagedProfiles", - counts.managed); + counts.supervised); UMA_HISTOGRAM_COUNTS_100("Profile.PercentageOfManagedProfiles", - 100 * counts.managed / counts.total); + 100 * counts.supervised / counts.total); UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfSignedInProfiles", counts.signedin); UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfUnusedProfiles", @@ -391,7 +391,7 @@ void ProfileMetrics::LogProfileLaunch(Profile* profile) { GetProfileType(profile_path), NUM_PROFILE_TYPE_METRICS); - if (profile->IsManaged()) { + if (profile->IsSupervised()) { content::RecordAction( base::UserMetricsAction("ManagedMode_NewManagedUserWindow")); } diff --git a/chrome/browser/signin/chrome_signin_client.cc b/chrome/browser/signin/chrome_signin_client.cc index f6a6b3e..c5550c4 100644 --- a/chrome/browser/signin/chrome_signin_client.cc +++ b/chrome/browser/signin/chrome_signin_client.cc @@ -117,7 +117,7 @@ bool ChromeSigninClient::CanRevokeCredentials() { #else // Don't allow revoking credentials for supervised users. // See http://crbug.com/332032 - if (profile_->IsManaged()) { + if (profile_->IsSupervised()) { LOG(ERROR) << "Attempt to revoke supervised user refresh " << "token detected, ignoring."; return false; diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc index 4f7e86a..d35a5d1 100644 --- a/chrome/browser/signin/signin_promo.cc +++ b/chrome/browser/signin/signin_promo.cc @@ -100,8 +100,8 @@ bool ShouldShowPromo(Profile* profile) { if (net::NetworkChangeNotifier::IsOffline()) return false; - // Don't show for managed profiles. - if (profile->IsManaged()) + // Don't show for supervised profiles. + if (profile->IsSupervised()) return false; // Display the signin promo if the user is not signed in. diff --git a/chrome/browser/sync/glue/synced_tab_delegate.h b/chrome/browser/sync/glue/synced_tab_delegate.h index 008748e..65b29ba 100644 --- a/chrome/browser/sync/glue/synced_tab_delegate.h +++ b/chrome/browser/sync/glue/synced_tab_delegate.h @@ -45,9 +45,9 @@ class SyncedTabDelegate { virtual content::NavigationEntry* GetEntryAtIndex(int i) const = 0; virtual content::NavigationEntry* GetActiveEntry() const = 0; - // Managed user related methods. + // Supervised user related methods. - virtual bool ProfileIsManaged() const = 0; + virtual bool ProfileIsSupervised() const = 0; virtual const std::vector<const content::NavigationEntry*>* GetBlockedNavigations() const = 0; diff --git a/chrome/browser/sync/glue/synced_tab_delegate_android.cc b/chrome/browser/sync/glue/synced_tab_delegate_android.cc index 3de039e..43140cf 100644 --- a/chrome/browser/sync/glue/synced_tab_delegate_android.cc +++ b/chrome/browser/sync/glue/synced_tab_delegate_android.cc @@ -99,9 +99,9 @@ void SyncedTabDelegateAndroid::SetWebContents( void SyncedTabDelegateAndroid::ResetWebContents() { web_contents_ = NULL; } -bool SyncedTabDelegateAndroid::ProfileIsManaged() const { +bool SyncedTabDelegateAndroid::ProfileIsSupervised() const { return TabContentsSyncedTabDelegate::FromWebContents(web_contents_) - ->ProfileIsManaged(); + ->ProfileIsSupervised(); } const std::vector<const content::NavigationEntry*>* diff --git a/chrome/browser/sync/glue/synced_tab_delegate_android.h b/chrome/browser/sync/glue/synced_tab_delegate_android.h index 90d239a..c910cf8 100644 --- a/chrome/browser/sync/glue/synced_tab_delegate_android.h +++ b/chrome/browser/sync/glue/synced_tab_delegate_android.h @@ -42,9 +42,9 @@ class SyncedTabDelegateAndroid : public browser_sync::SyncedTabDelegate { virtual int GetSyncId() const OVERRIDE; virtual void SetSyncId(int sync_id) OVERRIDE; - // Managed user related methods. + // Supervised user related methods. - virtual bool ProfileIsManaged() const OVERRIDE; + virtual bool ProfileIsSupervised() const OVERRIDE; virtual const std::vector<const content::NavigationEntry*>* GetBlockedNavigations() const OVERRIDE; diff --git a/chrome/browser/sync/managed_user_signin_manager_wrapper.cc b/chrome/browser/sync/managed_user_signin_manager_wrapper.cc index 960bde5..8765418 100644 --- a/chrome/browser/sync/managed_user_signin_manager_wrapper.cc +++ b/chrome/browser/sync/managed_user_signin_manager_wrapper.cc @@ -27,7 +27,7 @@ SigninManagerBase* ManagedUserSigninManagerWrapper::GetOriginal() { std::string ManagedUserSigninManagerWrapper::GetEffectiveUsername() const { const std::string& auth_username = original_->GetAuthenticatedUsername(); #if defined(ENABLE_MANAGED_USERS) - if (auth_username.empty() && profile_->IsManaged()) + if (auth_username.empty() && profile_->IsSupervised()) return managed_users::kManagedUserPseudoEmail; #endif return auth_username; @@ -36,7 +36,7 @@ std::string ManagedUserSigninManagerWrapper::GetEffectiveUsername() const { std::string ManagedUserSigninManagerWrapper::GetAccountIdToUse() const { const std::string& auth_account = original_->GetAuthenticatedAccountId(); #if defined(ENABLE_MANAGED_USERS) - if (auth_account.empty() && profile_->IsManaged()) + if (auth_account.empty() && profile_->IsSupervised()) return managed_users::kManagedUserPseudoEmail; #endif return auth_account; @@ -45,8 +45,8 @@ std::string ManagedUserSigninManagerWrapper::GetAccountIdToUse() const { std::string ManagedUserSigninManagerWrapper::GetSyncScopeToUse() const { #if defined(ENABLE_MANAGED_USERS) const std::string& auth_account = original_->GetAuthenticatedAccountId(); - if (auth_account.empty() && profile_->IsManaged()) - return GaiaConstants::kChromeSyncManagedOAuth2Scope; + if (auth_account.empty() && profile_->IsSupervised()) + return GaiaConstants::kChromeSyncSupervisedOAuth2Scope; #endif return GaiaConstants::kChromeSyncOAuth2Scope; } diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc index 587ae92..e1e268b 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc @@ -251,12 +251,12 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( } #if defined(ENABLE_MANAGED_USERS) - if (profile_->IsManaged()) { + if (profile_->IsSupervised()) { pss->RegisterDataTypeController( new UIDataTypeController( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), base::Bind(&ChromeReportUnrecoverableError), - syncer::MANAGED_USER_SETTINGS, + syncer::SUPERVISED_USER_SETTINGS, this, pss)); } else { @@ -264,7 +264,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( new UIDataTypeController( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), base::Bind(&ChromeReportUnrecoverableError), - syncer::MANAGED_USERS, + syncer::SUPERVISED_USERS, this, pss)); } @@ -272,7 +272,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( new UIDataTypeController( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), base::Bind(&ChromeReportUnrecoverableError), - syncer::MANAGED_USER_SHARED_SETTINGS, + syncer::SUPERVISED_USER_SHARED_SETTINGS, this, pss)); #endif @@ -512,13 +512,13 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: : base::WeakPtr<syncer::SyncableService>(); } #if defined(ENABLE_MANAGED_USERS) - case syncer::MANAGED_USER_SETTINGS: + case syncer::SUPERVISED_USER_SETTINGS: return ManagedUserSettingsServiceFactory::GetForProfile(profile_)-> AsWeakPtr(); - case syncer::MANAGED_USERS: + case syncer::SUPERVISED_USERS: return ManagedUserSyncServiceFactory::GetForProfile(profile_)-> AsWeakPtr(); - case syncer::MANAGED_USER_SHARED_SETTINGS: + case syncer::SUPERVISED_USER_SHARED_SETTINGS: return ManagedUserSharedSettingsServiceFactory::GetForBrowserContext( profile_)->AsWeakPtr(); #endif diff --git a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc index 22fae81..0f99fe7 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc @@ -70,8 +70,8 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test { channel == chrome::VersionInfo::CHANNEL_CANARY) { datatypes.push_back(syncer::SYNCED_NOTIFICATION_APP_INFO); } - datatypes.push_back(syncer::MANAGED_USERS); - datatypes.push_back(syncer::MANAGED_USER_SHARED_SETTINGS); + datatypes.push_back(syncer::SUPERVISED_USERS); + datatypes.push_back(syncer::SUPERVISED_USER_SHARED_SETTINGS); return datatypes; } diff --git a/chrome/browser/sync/sessions/notification_service_sessions_router.cc b/chrome/browser/sync/sessions/notification_service_sessions_router.cc index d1ab522..8edbb38 100644 --- a/chrome/browser/sync/sessions/notification_service_sessions_router.cc +++ b/chrome/browser/sync/sessions/notification_service_sessions_router.cc @@ -56,7 +56,7 @@ NotificationServiceSessionsRouter::NotificationServiceSessionsRouter( registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, content::Source<Profile>(profile_)); #if defined(ENABLE_MANAGED_USERS) - if (profile_->IsManaged()) { + if (profile_->IsSupervised()) { ManagedUserService* managed_user_service = ManagedUserServiceFactory::GetForProfile(profile_); managed_user_service->AddNavigationBlockedCallback( diff --git a/chrome/browser/sync/sessions/sessions_sync_manager.cc b/chrome/browser/sync/sessions/sessions_sync_manager.cc index 022176c..72a01d2 100644 --- a/chrome/browser/sync/sessions/sessions_sync_manager.cc +++ b/chrome/browser/sync/sessions/sessions_sync_manager.cc @@ -916,7 +916,7 @@ void SessionsSyncManager::SetSessionTabFromDelegate( const int min_index = std::max(0, current_index - kMaxSyncNavigationCount); const int max_index = std::min(current_index + kMaxSyncNavigationCount, tab_delegate.GetEntryCount()); - bool is_managed = tab_delegate.ProfileIsManaged(); + bool is_supervised = tab_delegate.ProfileIsSupervised(); session_tab->navigations.clear(); for (int i = min_index; i < max_index; ++i) { @@ -928,13 +928,13 @@ void SessionsSyncManager::SetSessionTabFromDelegate( session_tab->navigations.push_back( SerializedNavigationEntry::FromNavigationEntry(i, *entry)); - if (is_managed) { + if (is_supervised) { session_tab->navigations.back().set_blocked_state( SerializedNavigationEntry::STATE_ALLOWED); } } - if (is_managed) { + if (is_supervised) { const std::vector<const NavigationEntry*>& blocked_navigations = *tab_delegate.GetBlockedNavigations(); int offset = session_tab->navigations.size(); diff --git a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc index 74adf52..213fb74 100644 --- a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc +++ b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc @@ -356,7 +356,7 @@ class SyncedTabDelegateFake : public SyncedTabDelegate { public: SyncedTabDelegateFake() : current_entry_index_(0), pending_entry_index_(-1), - is_managed_(false), + is_supervised_(false), sync_id_(-1), blocked_navigations_(NULL) {} virtual ~SyncedTabDelegateFake() {} @@ -407,10 +407,10 @@ class SyncedTabDelegateFake : public SyncedTabDelegate { virtual content::NavigationEntry* GetActiveEntry() const OVERRIDE { return NULL; } - virtual bool ProfileIsManaged() const OVERRIDE { - return is_managed_; + virtual bool ProfileIsSupervised() const OVERRIDE { + return is_supervised_; } - void set_is_managed(bool is_managed) { is_managed_ = is_managed; } + void set_is_supervised(bool is_supervised) { is_supervised_ = is_supervised; } virtual const std::vector<const content::NavigationEntry*>* GetBlockedNavigations() const OVERRIDE { return blocked_navigations_; @@ -447,7 +447,7 @@ class SyncedTabDelegateFake : public SyncedTabDelegate { private: int current_entry_index_; int pending_entry_index_; - bool is_managed_; + bool is_supervised_; int sync_id_; std::vector<const content::NavigationEntry*>* blocked_navigations_; ScopedVector<content::NavigationEntry> entries_; @@ -580,8 +580,8 @@ TEST_F(SessionsSyncManagerTest, SetSessionTabFromDelegate) { EXPECT_TRUE(session_tab.session_storage_persistent_id.empty()); } -// Tests that for managed users blocked navigations are recorded and marked as -// such, while regular navigations are marked as allowed. +// Tests that for supervised users blocked navigations are recorded and marked +// as such, while regular navigations are marked as allowed. TEST_F(SessionsSyncManagerTest, BlockedNavigations) { SyncedTabDelegateFake tab; content::NavigationEntry* entry1(content::NavigationEntry::Create()); @@ -599,7 +599,7 @@ TEST_F(SessionsSyncManagerTest, BlockedNavigations) { blocked_navigations.push_back(entry2); blocked_navigations.push_back(entry3); - tab.set_is_managed(true); + tab.set_is_supervised(true); tab.set_blocked_navigations(&blocked_navigations.get()); SessionTab session_tab; diff --git a/chrome/browser/sync/sessions/sessions_util.cc b/chrome/browser/sync/sessions/sessions_util.cc index ed0d3fc..c8d7418f0 100644 --- a/chrome/browser/sync/sessions/sessions_util.cc +++ b/chrome/browser/sync/sessions/sessions_util.cc @@ -21,7 +21,7 @@ bool ShouldSyncTab(const SyncedTabDelegate& tab) { } // Does the tab have a valid NavigationEntry? - if (tab.ProfileIsManaged() && tab.GetBlockedNavigations()->size() > 0) + if (tab.ProfileIsSupervised() && tab.GetBlockedNavigations()->size() > 0) return true; int entry_count = tab.GetEntryCount(); diff --git a/chrome/browser/sync/startup_controller_unittest.cc b/chrome/browser/sync/startup_controller_unittest.cc index 3468410..42ef530 100644 --- a/chrome/browser/sync/startup_controller_unittest.cc +++ b/chrome/browser/sync/startup_controller_unittest.cc @@ -191,7 +191,7 @@ TEST_F(StartupControllerTest, NoDeferralWithoutSessionsSync) { types.Remove(syncer::SESSIONS); types.Remove(syncer::PROXY_TABS); types.Remove(syncer::TYPED_URLS); - types.Remove(syncer::MANAGED_USER_SETTINGS); + types.Remove(syncer::SUPERVISED_USER_SETTINGS); sync_prefs()->SetKeepEverythingSynced(false); sync_prefs()->SetPreferredDataTypes(syncer::UserTypes(), types); controller()->Reset(syncer::UserTypes()); diff --git a/chrome/browser/sync/test/integration/enable_disable_test.cc b/chrome/browser/sync/test/integration/enable_disable_test.cc index f186c55..856e1cb 100644 --- a/chrome/browser/sync/test/integration/enable_disable_test.cc +++ b/chrome/browser/sync/test/integration/enable_disable_test.cc @@ -92,9 +92,9 @@ IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, DisableOneAtATime) { for (syncer::ModelTypeSet::Iterator it = registered_types.First(); it.Good(); it.Inc()) { - // MANAGED_USERS and MANAGED_USER_SETTINGS are always synced. - if (it.Get() == syncer::MANAGED_USERS || - it.Get() == syncer::MANAGED_USER_SHARED_SETTINGS || + // SUPERVISED_USERS and SUPERVISED_USER_SHARED_SETTINGS are always synced. + if (it.Get() == syncer::SUPERVISED_USERS || + it.Get() == syncer::SUPERVISED_USER_SHARED_SETTINGS || it.Get() == syncer::SYNCED_NOTIFICATIONS || it.Get() == syncer::SYNCED_NOTIFICATION_APP_INFO) continue; diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc index 5a3cf8d..d9125c4 100644 --- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc +++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc @@ -161,7 +161,7 @@ bool ProfileSyncServiceHarness::SetupSync( service()->GoogleSigninSucceeded(username_, password_); #if defined(ENABLE_MANAGED_USERS) - std::string account_id = profile_->IsManaged() ? + std::string account_id = profile_->IsSupervised() ? managed_users::kManagedUserPseudoEmail : username_; #else std::string account_id = username_; diff --git a/chrome/browser/sync/test/integration/single_client_managed_user_settings_sync_test.cc b/chrome/browser/sync/test/integration/single_client_managed_user_settings_sync_test.cc index 6d22999..6fad88b 100644 --- a/chrome/browser/sync/test/integration/single_client_managed_user_settings_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_managed_user_settings_sync_test.cc @@ -24,7 +24,7 @@ class SingleClientManagedUserSettingsSyncTest : public SyncTest { // SyncTest overrides: virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { SyncTest::SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); + command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); } }; diff --git a/chrome/browser/themes/custom_theme_supplier.h b/chrome/browser/themes/custom_theme_supplier.h index 0ab9b0c..a6f2172 100644 --- a/chrome/browser/themes/custom_theme_supplier.h +++ b/chrome/browser/themes/custom_theme_supplier.h @@ -31,7 +31,7 @@ class CustomThemeSupplier : public base::RefCountedThreadSafe< enum ThemeType { EXTENSION, NATIVE_X11, - MANAGED_USER_THEME, + SUPERVISED_USER_THEME, }; explicit CustomThemeSupplier(ThemeType type); diff --git a/chrome/browser/themes/theme_properties.h b/chrome/browser/themes/theme_properties.h index f3674dd..0088e4d 100644 --- a/chrome/browser/themes/theme_properties.h +++ b/chrome/browser/themes/theme_properties.h @@ -88,9 +88,9 @@ class ThemeProperties { COLOR_NTP_SECTION_HEADER_RULE, COLOR_NTP_SECTION_HEADER_RULE_LIGHT, COLOR_NTP_TEXT_LIGHT, - COLOR_MANAGED_USER_LABEL, - COLOR_MANAGED_USER_LABEL_BACKGROUND, - COLOR_MANAGED_USER_LABEL_BORDER, + COLOR_SUPERVISED_USER_LABEL, + COLOR_SUPERVISED_USER_LABEL_BACKGROUND, + COLOR_SUPERVISED_USER_LABEL_BORDER, COLOR_STATUS_BAR_TEXT, diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index 3b22ccb..8d6d003 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc @@ -151,16 +151,16 @@ SkColor ThemeService::GetColor(int id) const { return IncreaseLightness(GetColor(Properties::COLOR_NTP_TEXT), 0.86); case Properties::COLOR_NTP_TEXT_LIGHT: return IncreaseLightness(GetColor(Properties::COLOR_NTP_TEXT), 0.40); - case Properties::COLOR_MANAGED_USER_LABEL: + case Properties::COLOR_SUPERVISED_USER_LABEL: return color_utils::GetReadableColor( SK_ColorWHITE, - GetColor(Properties::COLOR_MANAGED_USER_LABEL_BACKGROUND)); - case Properties::COLOR_MANAGED_USER_LABEL_BACKGROUND: + GetColor(Properties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND)); + case Properties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND: return color_utils::BlendTowardOppositeLuminance( GetColor(Properties::COLOR_FRAME), 0x80); - case Properties::COLOR_MANAGED_USER_LABEL_BORDER: + case Properties::COLOR_SUPERVISED_USER_LABEL_BORDER: return color_utils::AlphaBlend( - GetColor(Properties::COLOR_MANAGED_USER_LABEL_BACKGROUND), + GetColor(Properties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND), SK_ColorBLACK, 230); case Properties::COLOR_STATUS_BAR_TEXT: { @@ -373,8 +373,8 @@ void ThemeService::RemoveUnusedThemes(bool ignore_infobars) { void ThemeService::UseDefaultTheme() { if (ready_) content::RecordAction(UserMetricsAction("Themes_Reset")); - if (IsManagedUser()) { - SetManagedUserTheme(); + if (IsSupervisedUser()) { + SetSupervisedUserTheme(); return; } ClearAllThemeData(); @@ -432,9 +432,9 @@ void ThemeService::LoadThemePrefs() { std::string current_id = GetThemeID(); if (current_id == kDefaultThemeID) { - // Managed users have a different default theme. - if (IsManagedUser()) - SetManagedUserTheme(); + // Supervised users have a different default theme. + if (IsSupervisedUser()) + SetSupervisedUserTheme(); else if (ShouldInitWithSystemTheme()) UseSystemTheme(); else @@ -581,11 +581,11 @@ void ThemeService::BuildFromExtension(const Extension* extension) { SwapThemeSupplier(pack); } -bool ThemeService::IsManagedUser() const { - return profile_->IsManaged(); +bool ThemeService::IsSupervisedUser() const { + return profile_->IsSupervised(); } -void ThemeService::SetManagedUserTheme() { +void ThemeService::SetSupervisedUserTheme() { SetCustomDefaultTheme(new ManagedUserTheme); } diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h index a47a29b..b89a7ae 100644 --- a/chrome/browser/themes/theme_service.h +++ b/chrome/browser/themes/theme_service.h @@ -204,15 +204,12 @@ class ThemeService : public base::NonThreadSafe, // case we don't have a theme pack). void BuildFromExtension(const extensions::Extension* extension); - // Returns true if the profile belongs to a managed user. - bool IsManagedUser() const; + // Returns true if the profile belongs to a supervised user. + bool IsSupervisedUser() const; - // Sets the current theme to the managed user theme. Should only be used for - // managed user profiles. - void SetManagedUserTheme(); - - // Sets the managed user theme if the user has no custom theme yet. - void OnManagedUserInitialized(); + // Sets the current theme to the supervised user theme. Should only be used + // for supervised user profiles. + void SetSupervisedUserTheme(); #if defined(OS_MACOSX) // |nsimage_cache_| retains the images it has cached. diff --git a/chrome/browser/themes/theme_service_unittest.cc b/chrome/browser/themes/theme_service_unittest.cc index c834234..3238c10 100644 --- a/chrome/browser/themes/theme_service_unittest.cc +++ b/chrome/browser/themes/theme_service_unittest.cc @@ -30,7 +30,7 @@ namespace theme_service_internal { class ThemeServiceTest : public extensions::ExtensionServiceTestBase { public: - ThemeServiceTest() : is_managed_(false), + ThemeServiceTest() : is_supervised_(false), registry_(NULL) {} virtual ~ThemeServiceTest() {} @@ -86,7 +86,7 @@ class ThemeServiceTest : public extensions::ExtensionServiceTestBase { extensions::ExtensionServiceTestBase::SetUp(); extensions::ExtensionServiceTestBase::ExtensionServiceInitParams params = CreateDefaultInitParams(); - params.profile_is_managed = is_managed_; + params.profile_is_supervised = is_supervised_; InitializeExtensionService(params); service_->Init(); registry_ = ExtensionRegistry::Get(profile_.get()); @@ -98,7 +98,7 @@ class ThemeServiceTest : public extensions::ExtensionServiceTestBase { } protected: - bool is_managed_; + bool is_supervised_; ExtensionRegistry* registry_; }; @@ -230,32 +230,33 @@ TEST_F(ThemeServiceTest, ThemeUpgrade) { ExtensionRegistry::DISABLED)); } -class ThemeServiceManagedUserTest : public ThemeServiceTest { +class ThemeServiceSupervisedUserTest : public ThemeServiceTest { public: - ThemeServiceManagedUserTest() {} - virtual ~ThemeServiceManagedUserTest() {} + ThemeServiceSupervisedUserTest() {} + virtual ~ThemeServiceSupervisedUserTest() {} virtual void SetUp() OVERRIDE { - is_managed_ = true; + is_supervised_ = true; ThemeServiceTest::SetUp(); } }; -// Checks that managed users have their own default theme. -TEST_F(ThemeServiceManagedUserTest, ManagedUserThemeReplacesDefaultTheme) { +// Checks that supervised users have their own default theme. +TEST_F(ThemeServiceSupervisedUserTest, + SupervisedUserThemeReplacesDefaultTheme) { ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_.get()); theme_service->UseDefaultTheme(); EXPECT_TRUE(theme_service->UsingDefaultTheme()); EXPECT_TRUE(get_theme_supplier(theme_service)); EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(), - CustomThemeSupplier::MANAGED_USER_THEME); + CustomThemeSupplier::SUPERVISED_USER_THEME); } #if defined(OS_LINUX) && !defined(OS_CHROMEOS) -// Checks that managed users don't use the system theme even if it is the +// Checks that supervised users don't use the system theme even if it is the // default. The system theme is only available on Linux. -TEST_F(ThemeServiceManagedUserTest, ManagedUserThemeReplacesNativeTheme) { +TEST_F(ThemeServiceSupervisedUserTest, SupervisedUserThemeReplacesNativeTheme) { profile_->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, true); ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_.get()); @@ -263,7 +264,7 @@ TEST_F(ThemeServiceManagedUserTest, ManagedUserThemeReplacesNativeTheme) { EXPECT_TRUE(theme_service->UsingDefaultTheme()); EXPECT_TRUE(get_theme_supplier(theme_service)); EXPECT_EQ(get_theme_supplier(theme_service)->get_theme_type(), - CustomThemeSupplier::MANAGED_USER_THEME); + CustomThemeSupplier::SUPERVISED_USER_THEME); } #endif diff --git a/chrome/browser/ui/app_list/app_list_service_impl.cc b/chrome/browser/ui/app_list/app_list_service_impl.cc index 1a6a084..b10f722 100644 --- a/chrome/browser/ui/app_list/app_list_service_impl.cc +++ b/chrome/browser/ui/app_list/app_list_service_impl.cc @@ -130,12 +130,13 @@ class ProfileStoreImpl : public ProfileStore { return profile_manager_->user_data_dir(); } - virtual bool IsProfileManaged(const base::FilePath& profile_path) OVERRIDE { + virtual bool IsProfileSupervised( + const base::FilePath& profile_path) OVERRIDE { ProfileInfoCache& profile_info = g_browser_process->profile_manager()->GetProfileInfoCache(); size_t profile_index = profile_info.GetIndexOfProfileWithPath(profile_path); return profile_index != std::string::npos && - profile_info.ProfileIsManagedAtIndex(profile_index); + profile_info.ProfileIsSupervisedAtIndex(profile_index); } private: @@ -276,10 +277,10 @@ base::FilePath AppListServiceImpl::GetProfilePath( } void AppListServiceImpl::SetProfilePath(const base::FilePath& profile_path) { - // Ensure we don't set the pref to a managed user's profile path. - // TODO(calamity): Filter out managed profiles from the settings app so this - // can't get hit, so we can remove it. - if (profile_store_->IsProfileManaged(profile_path)) + // Ensure we don't set the pref to a supervised user's profile path. + // TODO(calamity): Filter out supervised profiles from the settings app so + // this can't get hit, so we can remove it. + if (profile_store_->IsProfileSupervised(profile_path)) return; local_state_->SetString( diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm index da828d7..cc55aef 100644 --- a/chrome/browser/ui/app_list/app_list_service_mac.mm +++ b/chrome/browser/ui/app_list/app_list_service_mac.mm @@ -397,7 +397,7 @@ void AppListServiceMac::CreateForProfile(Profile* requested_profile) { } void AppListServiceMac::ShowForProfile(Profile* requested_profile) { - if (requested_profile->IsManaged()) + if (requested_profile->IsSupervised()) return; InvalidatePendingProfileLoads(); diff --git a/chrome/browser/ui/app_list/app_list_service_views.cc b/chrome/browser/ui/app_list/app_list_service_views.cc index 7be99f9..2e6727a 100644 --- a/chrome/browser/ui/app_list/app_list_service_views.cc +++ b/chrome/browser/ui/app_list/app_list_service_views.cc @@ -31,7 +31,7 @@ void AppListServiceViews::CreateForProfile(Profile* requested_profile) { void AppListServiceViews::ShowForProfile(Profile* requested_profile) { DCHECK(requested_profile); - if (requested_profile->IsManaged()) + if (requested_profile->IsSupervised()) return; ScopedKeepAlive keep_alive; diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc index a2dea80..a67672b 100644 --- a/chrome/browser/ui/app_list/app_list_view_delegate.cc +++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc @@ -87,7 +87,7 @@ void PopulateUsers(const ProfileInfoCache& profile_info, const size_t count = profile_info.GetNumberOfProfiles(); for (size_t i = 0; i < count; ++i) { // Don't display managed users. - if (profile_info.ProfileIsManagedAtIndex(i)) + if (profile_info.ProfileIsSupervisedAtIndex(i)) continue; app_list::AppListViewDelegate::User user; diff --git a/chrome/browser/ui/app_list/profile_store.h b/chrome/browser/ui/app_list/profile_store.h index 92d61ac8..f1e3315 100644 --- a/chrome/browser/ui/app_list/profile_store.h +++ b/chrome/browser/ui/app_list/profile_store.h @@ -29,8 +29,8 @@ class ProfileStore { // Chrome. virtual base::FilePath GetUserDataDir() = 0; - // Returns true if the profile at |path| is managed. - virtual bool IsProfileManaged(const base::FilePath& path) = 0; + // Returns true if the profile at |path| is supervised. + virtual bool IsProfileSupervised(const base::FilePath& path) = 0; }; #endif // CHROME_BROWSER_UI_APP_LIST_PROFILE_STORE_H_ diff --git a/chrome/browser/ui/app_list/test/fake_profile.cc b/chrome/browser/ui/app_list/test/fake_profile.cc index 42d3120..61cd686 100644 --- a/chrome/browser/ui/app_list/test/fake_profile.cc +++ b/chrome/browser/ui/app_list/test/fake_profile.cc @@ -121,7 +121,7 @@ Profile* FakeProfile::GetOriginalProfile() { return this; } -bool FakeProfile::IsManaged() { +bool FakeProfile::IsSupervised() { return false; } diff --git a/chrome/browser/ui/app_list/test/fake_profile.h b/chrome/browser/ui/app_list/test/fake_profile.h index bb21082..869d5dc 100644 --- a/chrome/browser/ui/app_list/test/fake_profile.h +++ b/chrome/browser/ui/app_list/test/fake_profile.h @@ -76,7 +76,7 @@ class FakeProfile : public Profile { virtual void DestroyOffTheRecordProfile() OVERRIDE; virtual bool HasOffTheRecordProfile() OVERRIDE; virtual Profile* GetOriginalProfile() OVERRIDE; - virtual bool IsManaged() OVERRIDE; + virtual bool IsSupervised() OVERRIDE; virtual history::TopSites* GetTopSites() OVERRIDE; virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; virtual ExtensionService* GetExtensionService() OVERRIDE; diff --git a/chrome/browser/ui/app_list/test/fake_profile_store.cc b/chrome/browser/ui/app_list/test/fake_profile_store.cc index 85e46e1..9fc639c 100644 --- a/chrome/browser/ui/app_list/test/fake_profile_store.cc +++ b/chrome/browser/ui/app_list/test/fake_profile_store.cc @@ -59,6 +59,6 @@ base::FilePath FakeProfileStore::GetUserDataDir() { return user_data_dir_; } -bool FakeProfileStore::IsProfileManaged(const base::FilePath& path) { +bool FakeProfileStore::IsProfileSupervised(const base::FilePath& path) { return false; } diff --git a/chrome/browser/ui/app_list/test/fake_profile_store.h b/chrome/browser/ui/app_list/test/fake_profile_store.h index b1dc863..68622dc 100644 --- a/chrome/browser/ui/app_list/test/fake_profile_store.h +++ b/chrome/browser/ui/app_list/test/fake_profile_store.h @@ -26,7 +26,7 @@ class FakeProfileStore : public ProfileStore { base::Callback<void(Profile*)> callback) OVERRIDE; virtual Profile* GetProfileByPath(const base::FilePath& path) OVERRIDE; virtual base::FilePath GetUserDataDir() OVERRIDE; - virtual bool IsProfileManaged(const base::FilePath& path) OVERRIDE; + virtual bool IsProfileSupervised(const base::FilePath& path) OVERRIDE; private: base::FilePath user_data_dir_; diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc index 138ad5a..6744596 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc @@ -257,7 +257,7 @@ void ChromeShellDelegate::Observe(int type, case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: { Profile* profile = content::Details<Profile>(details).ptr(); if (!chromeos::ProfileHelper::IsSigninProfile(profile) && - !profile->IsGuestSession() && !profile->IsManaged()) { + !profile->IsGuestSession() && !profile->IsSupervised()) { // Start the error notifier services to show auth/sync notifications. SigninErrorNotifierFactory::GetForProfile(profile); SyncErrorNotifierFactory::GetForProfile(profile); diff --git a/chrome/browser/ui/bookmarks/bookmark_utils.cc b/chrome/browser/ui/bookmarks/bookmark_utils.cc index 59c1aed..72af92d 100644 --- a/chrome/browser/ui/bookmarks/bookmark_utils.cc +++ b/chrome/browser/ui/bookmarks/bookmark_utils.cc @@ -318,9 +318,9 @@ base::string16 FormatBookmarkURLForDisplay(const GURL& url, bool IsAppsShortcutEnabled(Profile* profile, chrome::HostDesktopType host_desktop_type) { - // Managed users can not have apps installed currently so there's no need to - // show the apps shortcut. - if (profile->IsManaged()) + // Supervised users can not have apps installed currently so there's no need + // to show the apps shortcut. + if (profile->IsSupervised()) return false; // Don't show the apps shortcut in ash since the app launcher is enabled. diff --git a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm index dbacedb..472af31 100644 --- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm @@ -208,7 +208,7 @@ NSImage* GetImageFromResourceID(int resourceId) { base::string16 profileName = [self getElidedAvatarName]; NSString* buttonTitle = nil; - if (browser_->profile()->IsManaged()) { + if (browser_->profile()->IsSupervised()) { // Add the "supervised" label after eliding the profile name, so the label // will not get elided, but will instead enlarge the button. buttonTitle = l10n_util::GetNSStringF(IDS_MANAGED_USER_NEW_AVATAR_LABEL, diff --git a/chrome/browser/ui/cocoa/profiles/avatar_icon_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_icon_controller.mm index a35b801..819e53a 100644 --- a/chrome/browser/ui/cocoa/profiles/avatar_icon_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/avatar_icon_controller.mm @@ -111,9 +111,9 @@ const CGFloat kAvatarLabelRightSpacing = 2; [self setButtonEnabled:YES]; [self updateAvatarButtonAndLayoutParent:NO]; - // Managed users cannot enter incognito mode, so we only need to check + // Supervised users cannot enter incognito mode, so we only need to check // it in this code path. - if (profile->IsManaged()) { + if (profile->IsSupervised()) { // Initialize the avatar label button. CGFloat extraWidth = profiles::kAvatarIconWidth + kAvatarLabelRightSpacing; diff --git a/chrome/browser/ui/cocoa/profiles/avatar_icon_controller_unittest.mm b/chrome/browser/ui/cocoa/profiles/avatar_icon_controller_unittest.mm index 6c36ae1..db4083b 100644 --- a/chrome/browser/ui/cocoa/profiles/avatar_icon_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/profiles/avatar_icon_controller_unittest.mm @@ -92,16 +92,16 @@ TEST_F(AvatarIconControllerTest, DoubleOpen) { testing_profile_manager()->DeleteTestingProfile("p2"); } -TEST_F(AvatarIconControllerTest, ManagedUserLabel) { - DCHECK(!profile()->IsManaged()); +TEST_F(AvatarIconControllerTest, SupervisedUserLabel) { + DCHECK(!profile()->IsSupervised()); EXPECT_FALSE([controller() labelButtonView]); - // Create a second, managed profile to enable the avatar menu. + // Create a second, supervised profile to enable the avatar menu. std::string name = "p2"; TestingProfile* profile = testing_profile_manager()->CreateTestingProfile( name, scoped_ptr<PrefServiceSyncable>(), base::ASCIIToUTF16(name), 0, "asdf", TestingProfile::TestingFactories()); - EXPECT_TRUE(profile->IsManaged()); + EXPECT_TRUE(profile->IsSupervised()); // http://crbug.com/39725 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( @@ -115,7 +115,7 @@ TEST_F(AvatarIconControllerTest, ManagedUserLabel) { Browser* browser = new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop())); // Build a new controller to check if it is initialized correctly for a - // managed user profile. + // supervised user profile. base::scoped_nsobject<AvatarIconController> controller( [[AvatarIconController alloc] initWithBrowser:browser]); diff --git a/chrome/browser/ui/cocoa/profiles/avatar_label_button.mm b/chrome/browser/ui/cocoa/profiles/avatar_label_button.mm index 8813668..daa9761 100644 --- a/chrome/browser/ui/cocoa/profiles/avatar_label_button.mm +++ b/chrome/browser/ui/cocoa/profiles/avatar_label_button.mm @@ -82,7 +82,7 @@ const CGFloat kLabelTextBottomSpacing = 4; ui::ThemeProvider* themeProvider = [[controlView window] themeProvider]; if (themeProvider) { NSColor* textColor = themeProvider->GetNSColor( - ThemeProperties::COLOR_MANAGED_USER_LABEL); + ThemeProperties::COLOR_SUPERVISED_USER_LABEL); [themedTitle addAttribute:NSForegroundColorAttributeName value:textColor range:NSMakeRange(0, title.length)]; @@ -97,7 +97,7 @@ const CGFloat kLabelTextBottomSpacing = 4; // Draw the label button background using the color provided by // |themeProvider|. First paint the border. NSColor* borderColor = themeProvider->GetNSColor( - ThemeProperties::COLOR_MANAGED_USER_LABEL_BORDER); + ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BORDER); if ([self isHighlighted]) { borderColor = [borderColor blendedColorWithFraction:0.5 ofColor:[NSColor blackColor]]; @@ -115,7 +115,7 @@ const CGFloat kLabelTextBottomSpacing = 4; // Now paint the background. NSColor* backgroundColor = themeProvider->GetNSColor( - ThemeProperties::COLOR_MANAGED_USER_LABEL_BACKGROUND); + ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND); if ([self isHighlighted]) { backgroundColor = [backgroundColor blendedColorWithFraction:0.5 diff --git a/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.mm index 98335a3..f9a234f 100644 --- a/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.mm @@ -27,7 +27,7 @@ @interface AvatarMenuBubbleController (Private) - (AvatarMenu*)menu; -- (NSView*)configureManagedUserInformation:(CGFloat)width; +- (NSView*)configureSupervisedUserInformation:(CGFloat)width; - (NSButton*)configureNewUserButton:(CGFloat)yOffset updateWidthAdjust:(CGFloat*)widthAdjust; - (NSButton*)configureSwitchUserButton:(CGFloat)yOffset @@ -37,7 +37,7 @@ setYOffset:(CGFloat)yOffset; - (void)setWindowFrame:(CGFloat)yOffset widthAdjust:(CGFloat)width; - (void)initMenuContents; -- (void)initManagedUserContents; +- (void)initSupervisedUserContents; - (void)keyDown:(NSEvent*)theEvent; - (void)moveDown:(id)sender; - (void)moveUp:(id)sender; @@ -59,8 +59,9 @@ const CGFloat kVerticalSpacing = 10.0; const CGFloat kLinkSpacing = 15.0; const CGFloat kLabelInset = 49.0; -// The offset of the managed user information label and the "switch user" link. -const CGFloat kManagedUserSpacing = 26.0; +// The offset of the supervised user information label and the "switch user" +// link. +const CGFloat kSupervisedUserSpacing = 26.0; } // namespace @@ -195,8 +196,8 @@ const CGFloat kManagedUserSpacing = 26.0; - (void)setWindowFrame:(CGFloat)yOffset widthAdjust:(CGFloat)width { // Set the window frame, clamping the width at a sensible max. NSRect frame = [[self window] frame]; - // Adjust the origin after we have switched from the managed user menu to the - // regular menu. + // Adjust the origin after we have switched from the supervised user menu to + // the regular menu. CGFloat newWidth = std::min(kBubbleMinWidth + width, kBubbleMaxWidth); if (expanded_) { frame.origin.x += frame.size.width - newWidth; @@ -246,7 +247,7 @@ const CGFloat kManagedUserSpacing = 26.0; [self setWindowFrame:yOffset widthAdjust:widthAdjust]; } -- (void)initManagedUserContents { +- (void)initSupervisedUserContents { NSView* contentView = [[self window] contentView]; // |yOffset| is the next position at which to draw in contentView coordinates. @@ -270,7 +271,7 @@ const CGFloat kManagedUserSpacing = 26.0; // First init the active profile in order to determine the required width. We // will have to adjust its frame later after adding general information about - // managed users. + // supervised users. AvatarMenuItemController* itemView = [self initAvatarItem:menu_->GetActiveProfileIndex() updateWidthAdjust:&widthAdjust @@ -281,8 +282,8 @@ const CGFloat kManagedUserSpacing = 26.0; widthAdjust = std::min(widthAdjust, kBubbleMaxWidth - kBubbleMinWidth); CGFloat newWidth = kBubbleMinWidth + widthAdjust; - // Add general information about managed users. - NSView* info = [self configureManagedUserInformation:newWidth]; + // Add general information about supervised users. + NSView* info = [self configureSupervisedUserInformation:newWidth]; [info setFrameOrigin:NSMakePoint(0, yOffset)]; [contentView addSubview:info]; yOffset += NSHeight([info frame]) + kVerticalSpacing; @@ -311,31 +312,31 @@ const CGFloat kManagedUserSpacing = 26.0; items_.reset([[NSMutableArray alloc] init]); [contentView setSubviews:[NSArray array]]; - if (menu_->GetManagedUserInformation().empty() || expanded_) + if (menu_->GetSupervisedUserInformation().empty() || expanded_) [self initMenuContents]; else - [self initManagedUserContents]; + [self initSupervisedUserContents]; } -- (NSView*)configureManagedUserInformation:(CGFloat)width { +- (NSView*)configureSupervisedUserInformation:(CGFloat)width { base::scoped_nsobject<NSView> container( [[NSView alloc] initWithFrame:NSZeroRect]); // Add the limited user icon on the left side of the information TextView. base::scoped_nsobject<NSImageView> iconView( [[NSImageView alloc] initWithFrame:NSMakeRect(5, 0, 16, 16)]); - [iconView setImage:menu_->GetManagedUserIcon().ToNSImage()]; + [iconView setImage:menu_->GetSupervisedUserIcon().ToNSImage()]; [container addSubview:iconView]; NSString* info = - base::SysUTF16ToNSString(menu_->GetManagedUserInformation()); + base::SysUTF16ToNSString(menu_->GetSupervisedUserInformation()); NSDictionary* attributes = @{ NSFontAttributeName : [NSFont labelFontOfSize:12] }; base::scoped_nsobject<NSAttributedString> attrString( [[NSAttributedString alloc] initWithString:info attributes:attributes]); base::scoped_nsobject<NSTextView> label( [[NSTextView alloc] initWithFrame:NSMakeRect( - kManagedUserSpacing, 0, width - kManagedUserSpacing - 5, 0)]); + kSupervisedUserSpacing, 0, width - kSupervisedUserSpacing - 5, 0)]); [[label textStorage] setAttributedString:attrString]; [label setHorizontallyResizable:NO]; [label setEditable:NO]; @@ -370,7 +371,7 @@ const CGFloat kManagedUserSpacing = 26.0; updateWidthAdjust:(CGFloat*)widthAdjust { base::scoped_nsobject<NSButton> newButton( [[NSButton alloc] initWithFrame:NSMakeRect( - kManagedUserSpacing, yOffset, kBubbleMinWidth - kLabelInset, 16)]); + kSupervisedUserSpacing, yOffset, kBubbleMinWidth - kLabelInset, 16)]); base::scoped_nsobject<HyperlinkButtonCell> buttonCell( [[HyperlinkButtonCell alloc] initTextCell: l10n_util::GetNSString(IDS_PROFILES_SWITCH_PROFILE_LINK)]); diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm index c1b8466..ba08b6d 100644 --- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm @@ -1028,7 +1028,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, } // For supervised users, add the disclaimer text. - if (browser_->profile()->IsManaged()) { + if (browser_->profile()->IsSupervised()) { yOffset += kSmallVerticalSpacing; NSView* disclaimerContainer = [self createSupervisedUserDisclaimerView]; [disclaimerContainer setFrameOrigin:NSMakePoint(0, yOffset)]; @@ -1239,7 +1239,8 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, } // Profile name, centered. - bool editingAllowed = !isGuestSession_ && !browser_->profile()->IsManaged(); + bool editingAllowed = !isGuestSession_ && + !browser_->profile()->IsSupervised(); base::scoped_nsobject<EditableProfileNameButton> profileName( [[EditableProfileNameButton alloc] initWithFrame:NSMakeRect(xOffset, yOffset, @@ -1268,7 +1269,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, [container addSubview:iconView]; yOffset = NSMaxY([iconView frame]); - if (browser_->profile()->IsManaged()) { + if (browser_->profile()->IsSupervised()) { base::scoped_nsobject<NSImageView> supervisedIcon( [[NSImageView alloc] initWithFrame:NSZeroRect]); ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); @@ -1370,7 +1371,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, int availableTextWidth = kFixedMenuWidth - 2 * kHorizontalSpacing; NSTextField* disclaimer = BuildLabel( - base::SysUTF16ToNSString(avatarMenu_->GetManagedUserInformation()), + base::SysUTF16ToNSString(avatarMenu_->GetSupervisedUserInformation()), NSMakePoint(kHorizontalSpacing, yOffset), nil /* background_color */, nil /* text_color */); diff --git a/chrome/browser/ui/cocoa/profiles/profile_menu_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_menu_controller.mm index 211ed58..9e58c2e 100644 --- a/chrome/browser/ui/cocoa/profiles/profile_menu_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/profile_menu_controller.mm @@ -161,14 +161,14 @@ class Observer : public chrome::BrowserListObserver, menu_->GetActiveProfileIndex()); if ([menuItem action] == @selector(switchToProfileFromDock:) || [menuItem action] == @selector(switchToProfileFromMenu:)) { - if (!itemData.managed) + if (!itemData.supervised) return YES; return [menuItem tag] == static_cast<NSInteger>(itemData.menu_index); } if ([menuItem action] == @selector(newProfile:)) - return !itemData.managed; + return !itemData.supervised; return YES; } diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc index 11acf13..16fdb45f 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc @@ -1002,7 +1002,7 @@ class ManagedModeBrowserCreatorTest : public InProcessBrowserTest { protected: virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { InProcessBrowserTest::SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); + command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); } }; diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc index c0b3e05..8e5c447 100644 --- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc +++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc @@ -74,8 +74,8 @@ NavigationEntry* TabContentsSyncedTabDelegate::GetActiveEntry() const { return web_contents_->GetController().GetVisibleEntry(); } -bool TabContentsSyncedTabDelegate::ProfileIsManaged() const { - return profile()->IsManaged(); +bool TabContentsSyncedTabDelegate::ProfileIsSupervised() const { + return profile()->IsSupervised(); } const std::vector<const content::NavigationEntry*>* diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h index 5525f16..76bad7dbd 100644 --- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h +++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h @@ -32,7 +32,7 @@ class TabContentsSyncedTabDelegate virtual content::NavigationEntry* GetPendingEntry() const OVERRIDE; virtual content::NavigationEntry* GetEntryAtIndex(int i) const OVERRIDE; virtual content::NavigationEntry* GetActiveEntry() const OVERRIDE; - virtual bool ProfileIsManaged() const OVERRIDE; + virtual bool ProfileIsSupervised() const OVERRIDE; virtual const std::vector<const content::NavigationEntry*>* GetBlockedNavigations() const OVERRIDE; virtual bool IsPinned() const OVERRIDE; diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 26a1760..2b2d50f 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -512,7 +512,7 @@ WrenchMenuModel::WrenchMenuModel() } bool WrenchMenuModel::ShouldShowNewIncognitoWindowMenuItem() { - if (browser_->profile()->IsManaged()) + if (browser_->profile()->IsSupervised()) return false; return !browser_->profile()->IsGuestSession(); diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc index d83a382..a6ba3c2 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc @@ -60,7 +60,7 @@ void BrowserNonClientFrameView::UpdateAvatarInfo() { if (browser_view_->ShouldShowAvatar()) { if (!avatar_button_) { Profile* profile = browser_view_->browser()->profile(); - if (profile->IsManaged() && !avatar_label_) { + if (profile->IsSupervised() && !avatar_label_) { avatar_label_ = new AvatarLabel(browser_view_); avatar_label_->set_id(VIEW_ID_AVATAR_LABEL); AddChildView(avatar_label_); diff --git a/chrome/browser/ui/views/profiles/avatar_label.cc b/chrome/browser/ui/views/profiles/avatar_label.cc index 2cd9d63..7b7bad7 100644 --- a/chrome/browser/ui/views/profiles/avatar_label.cc +++ b/chrome/browser/ui/views/profiles/avatar_label.cc @@ -18,7 +18,7 @@ namespace { -// A custom border for the managed user avatar label. +// A custom border for the supervised user avatar label. class AvatarLabelBorder : public views::Border { public: explicit AvatarLabelBorder(bool label_on_right); @@ -64,7 +64,7 @@ void AvatarLabelBorder::Paint(const views::View& view, gfx::Canvas* canvas) { SkPaint paint; int kRadius = 2; SkColor background_color = view.GetThemeProvider()->GetColor( - ThemeProperties::COLOR_MANAGED_USER_LABEL_BACKGROUND); + ThemeProperties::COLOR_SUPERVISED_USER_LABEL_BACKGROUND); paint.setStyle(SkPaint::kFill_Style); // Paint the inner border with a color slightly darker than the background. @@ -117,7 +117,7 @@ void AvatarLabel::UpdateLabelStyle() { return; SkColor color_label = browser_view_->frame()->GetThemeProvider()->GetColor( - ThemeProperties::COLOR_MANAGED_USER_LABEL); + ThemeProperties::COLOR_SUPERVISED_USER_LABEL); for (size_t state = 0; state < STATE_COUNT; ++state) SetTextColor(static_cast<ButtonState>(state), color_label); SchedulePaint(); diff --git a/chrome/browser/ui/views/profiles/avatar_label.h b/chrome/browser/ui/views/profiles/avatar_label.h index 8838d7e..9126d02 100644 --- a/chrome/browser/ui/views/profiles/avatar_label.h +++ b/chrome/browser/ui/views/profiles/avatar_label.h @@ -13,7 +13,7 @@ class BrowserView; // AvatarLabel // // A label used to display a string indicating that the current profile belongs -// to a managed user. +// to a supervised user. class AvatarLabel : public views::LabelButton { public: explicit AvatarLabel(BrowserView* browser_view); diff --git a/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc index 55f8d0c..a9b6273 100644 --- a/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc +++ b/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.cc @@ -526,7 +526,7 @@ AvatarMenuBubbleView::AvatarMenuBubbleView( browser_(browser), separator_(NULL), buttons_view_(NULL), - managed_user_info_(NULL), + supervised_user_info_(NULL), separator_switch_users_(NULL), expanded_(false) { avatar_menu_.reset(new AvatarMenu( @@ -558,7 +558,7 @@ gfx::Size AvatarMenuBubbleView::GetPreferredSize() const { } - if (managed_user_info_) { + if (supervised_user_info_) { // First handle the switch profile link because it can still affect the // preferred width. gfx::Size size = switch_profile_link_->GetPreferredSize(); @@ -577,13 +577,14 @@ gfx::Size AvatarMenuBubbleView::GetPreferredSize() const { // We have to do this after the final width is calculated, since the label // will wrap based on the width. - if (managed_user_info_) { + if (supervised_user_info_) { int remaining_width = preferred_size.width() - icon_view_->GetPreferredSize().width() - views::kRelatedControlSmallHorizontalSpacing; preferred_size.Enlarge( 0, - managed_user_info_->GetHeightForWidth(remaining_width) + kItemMarginY); + supervised_user_info_->GetHeightForWidth(remaining_width) + + kItemMarginY); } return preferred_size; @@ -600,7 +601,7 @@ void AvatarMenuBubbleView::Layout() { } int separator_height; - if (buttons_view_ || managed_user_info_) { + if (buttons_view_ || supervised_user_info_) { separator_height = separator_->GetPreferredSize().height(); y += kSeparatorPaddingY; separator_->SetBounds(0, y, width(), separator_height); @@ -610,14 +611,14 @@ void AvatarMenuBubbleView::Layout() { if (buttons_view_) { buttons_view_->SetBounds(0, y, width(), buttons_view_->GetPreferredSize().height()); - } else if (managed_user_info_) { + } else if (supervised_user_info_) { gfx::Size icon_size = icon_view_->GetPreferredSize(); gfx::Rect icon_bounds(0, y, icon_size.width(), icon_size.height()); icon_view_->SetBoundsRect(icon_bounds); int info_width = width() - icon_bounds.right() - views::kRelatedControlSmallHorizontalSpacing; - int height = managed_user_info_->GetHeightForWidth(info_width); - managed_user_info_->SetBounds( + int height = supervised_user_info_->GetHeightForWidth(info_width); + supervised_user_info_->SetBounds( icon_bounds.right() + views::kRelatedControlSmallHorizontalSpacing, y, info_width, height); y += height + kItemMarginY + kSeparatorPaddingY; @@ -745,9 +746,9 @@ void AvatarMenuBubbleView::InitMenuContents( } } -void AvatarMenuBubbleView::InitManagedUserContents( +void AvatarMenuBubbleView::InitSupervisedUserContents( AvatarMenu* avatar_menu) { - // Show the profile of the managed user. + // Show the profile of the supervised user. size_t active_index = avatar_menu->GetActiveProfileIndex(); const AvatarMenu::Item& item = avatar_menu->GetItemAt(active_index); @@ -761,19 +762,19 @@ void AvatarMenuBubbleView::InitManagedUserContents( separator_ = new views::Separator(views::Separator::HORIZONTAL); AddChildView(separator_); - // Add information about managed users. - managed_user_info_ = - new views::Label(avatar_menu_->GetManagedUserInformation(), + // Add information about supervised users. + supervised_user_info_ = + new views::Label(avatar_menu_->GetSupervisedUserInformation(), ui::ResourceBundle::GetSharedInstance().GetFontList( ui::ResourceBundle::SmallFont)); - managed_user_info_->SetMultiLine(true); - managed_user_info_->SetHorizontalAlignment(gfx::ALIGN_LEFT); - managed_user_info_->SetBackgroundColor(color()); - AddChildView(managed_user_info_); + supervised_user_info_->SetMultiLine(true); + supervised_user_info_->SetHorizontalAlignment(gfx::ALIGN_LEFT); + supervised_user_info_->SetBackgroundColor(color()); + AddChildView(supervised_user_info_); - // Add the managed user icon. + // Add the supervised user icon. icon_view_ = new views::ImageView(); - icon_view_->SetImage(avatar_menu_->GetManagedUserIcon().ToImageSkia()); + icon_view_->SetImage(avatar_menu_->GetSupervisedUserIcon().ToImageSkia()); AddChildView(icon_view_); // Add a link for switching profiles. @@ -792,14 +793,14 @@ void AvatarMenuBubbleView::OnAvatarMenuChanged( // Unset all our child view references and call RemoveAllChildViews() which // will actually delete them. buttons_view_ = NULL; - managed_user_info_ = NULL; + supervised_user_info_ = NULL; item_views_.clear(); RemoveAllChildViews(true); - if (avatar_menu_->GetManagedUserInformation().empty() || expanded_) + if (avatar_menu_->GetSupervisedUserInformation().empty() || expanded_) InitMenuContents(avatar_menu); else - InitManagedUserContents(avatar_menu); + InitSupervisedUserContents(avatar_menu); // If the bubble has already been shown then resize and reposition the bubble. Layout(); diff --git a/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h b/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h index 3e8fd1e..11fe86a 100644 --- a/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h +++ b/chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h @@ -101,8 +101,8 @@ class AvatarMenuBubbleView : public views::BubbleDelegateView, // Create the menu contents for a normal profile. void InitMenuContents(AvatarMenu* avatar_menu); - // Create the managed user specific contents of the menu. - void InitManagedUserContents(AvatarMenu* avatar_menu); + // Create the supervised user specific contents of the menu. + void InitSupervisedUserContents(AvatarMenu* avatar_menu); scoped_ptr<AvatarMenu> avatar_menu_; gfx::Rect anchor_rect_; @@ -118,9 +118,9 @@ class AvatarMenuBubbleView : public views::BubbleDelegateView, views::View* buttons_view_; // This will be non-NULL if and only if |expanded_| is false and - // avatar_menu_->GetManagedUserInformation() returns a non-empty string. + // avatar_menu_->GetSupervisedUserInformation() returns a non-empty string. // See OnAvatarMenuChanged(). - views::Label* managed_user_info_; + views::Label* supervised_user_info_; views::ImageView* icon_view_; views::Separator* separator_switch_users_; views::Link* switch_profile_link_; @@ -128,7 +128,7 @@ class AvatarMenuBubbleView : public views::BubbleDelegateView, static AvatarMenuBubbleView* avatar_bubble_; static bool close_on_deactivate_for_testing_; - // Is set to true if the managed user has clicked on Switch Users. + // Is set to true if the supervised user has clicked on Switch Users. bool expanded_; DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc index cd05657..173eb14 100644 --- a/chrome/browser/ui/views/profiles/new_avatar_button.cc +++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc @@ -56,7 +56,7 @@ base::string16 GetElidedText(const base::string16& original_text) { base::string16 GetButtonText(Profile* profile) { base::string16 name = GetElidedText( profiles::GetAvatarNameForProfile(profile)); - if (profile->IsManaged()) + if (profile->IsSupervised()) name = l10n_util::GetStringFUTF16(IDS_MANAGED_USER_NEW_AVATAR_LABEL, name); return name; } diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc index 29ec7e0..2276f0c7 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc @@ -774,7 +774,7 @@ bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender, active_item.profile_path); DCHECK(profile); - if (profile->IsManaged()) + if (profile->IsSupervised()) return true; profiles::UpdateProfileName(profile, new_profile_name); @@ -849,7 +849,7 @@ views::View* ProfileChooserView::CreateProfileChooserView( layout->StartRow(1, 0); layout->AddView(current_profile_view); - if (browser_->profile()->IsManaged()) { + if (browser_->profile()->IsSupervised()) { layout->StartRow(0, 0); layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); layout->StartRow(1, 0); @@ -1051,7 +1051,7 @@ views::View* ProfileChooserView::CreateCurrentProfileView( current_profile_photo_->AddChildView(question_mark_button_); } - if (browser_->profile()->IsManaged()) { + if (browser_->profile()->IsSupervised()) { views::ImageView* supervised_icon = new views::ImageView(); ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); supervised_icon->SetImage( @@ -1070,7 +1070,7 @@ views::View* ProfileChooserView::CreateCurrentProfileView( layout->AddView(current_profile_photo_); // Profile name, centered. - bool editing_allowed = !is_guest && !browser_->profile()->IsManaged(); + bool editing_allowed = !is_guest && !browser_->profile()->IsSupervised(); current_profile_name_ = new EditableProfileName( this, profiles::GetAvatarNameForProfile(browser_->profile()), editing_allowed); @@ -1221,7 +1221,7 @@ views::View* ProfileChooserView::CreateSupervisedUserDisclaimerView() { views::kRelatedControlVerticalSpacing, views::kButtonHEdgeMarginNew); views::Label* disclaimer = new views::Label( - avatar_menu_->GetManagedUserInformation()); + avatar_menu_->GetSupervisedUserInformation()); disclaimer->SetMultiLine(true); disclaimer->SetHorizontalAlignment(gfx::ALIGN_LEFT); ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); diff --git a/chrome/browser/ui/webui/downloads_ui.cc b/chrome/browser/ui/webui/downloads_ui.cc index 6e3ddcf..a19db37 100644 --- a/chrome/browser/ui/webui/downloads_ui.cc +++ b/chrome/browser/ui/webui/downloads_ui.cc @@ -82,7 +82,7 @@ content::WebUIDataSource* CreateDownloadsUIHTMLSource(Profile* profile) { PrefService* prefs = profile->GetPrefs(); source->AddBoolean("allow_deleting_history", prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory)); - source->AddBoolean("show_delete_history", !profile->IsManaged()); + source->AddBoolean("show_delete_history", !profile->IsSupervised()); source->SetJsonPath("strings.js"); source->AddResourcePath("downloads.css", IDR_DOWNLOADS_CSS); diff --git a/chrome/browser/ui/webui/downloads_ui_browsertest.cc b/chrome/browser/ui/webui/downloads_ui_browsertest.cc index 7df6830..7531155 100644 --- a/chrome/browser/ui/webui/downloads_ui_browsertest.cc +++ b/chrome/browser/ui/webui/downloads_ui_browsertest.cc @@ -25,5 +25,5 @@ void DownloadsUIBrowserTest::SetDeleteAllowed(bool allowed) { void DownloadsWebUIForSupervisedUsersTest::SetUpCommandLine( CommandLine* command_line) { - command_line->AppendSwitchASCII(switches::kManagedUserId, "asdf"); + command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); } diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index 1e667a5..f25b8db 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -810,11 +810,11 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData( } results.Set("extensions", extensions_list); - bool is_managed = profile->IsManaged(); + bool is_supervised = profile->IsSupervised(); bool developer_mode = - !is_managed && + !is_supervised && profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode); - results.SetBoolean("profileIsManaged", is_managed); + results.SetBoolean("profileIsManaged", is_supervised); results.SetBoolean("developerMode", developer_mode); // Promote the Chrome Apps & Extensions Developer Tools if they are not @@ -849,7 +849,7 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData( void ExtensionSettingsHandler::HandleToggleDeveloperMode( const base::ListValue* args) { Profile* profile = Profile::FromWebUI(web_ui()); - if (profile->IsManaged()) + if (profile->IsSupervised()) return; bool developer_mode = diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc index 65bf417..604624c 100644 --- a/chrome/browser/ui/webui/history_ui.cc +++ b/chrome/browser/ui/webui/history_ui.cc @@ -184,8 +184,8 @@ content::WebUIDataSource* CreateHistoryUIHTMLSource(Profile* profile) { source->SetDefaultResource(IDR_HISTORY_HTML); source->SetUseJsonJSFormatV2(); source->DisableDenyXFrameOptions(); - source->AddBoolean("isManagedProfile", profile->IsManaged()); - source->AddBoolean("showDeleteVisitUI", !profile->IsManaged()); + source->AddBoolean("isManagedProfile", profile->IsSupervised()); + source->AddBoolean("showDeleteVisitUI", !profile->IsSupervised()); return source; } @@ -711,7 +711,7 @@ void BrowsingHistoryHandler::ReturnResultsToFrontEnd() { BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile); ManagedUserService* managed_user_service = NULL; #if defined(ENABLE_MANAGED_USERS) - if (profile->IsManaged()) + if (profile->IsSupervised()) managed_user_service = ManagedUserServiceFactory::GetForProfile(profile); #endif ProfileSyncService* sync_service = diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc index e170f779..64adc19 100644 --- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc +++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc @@ -227,7 +227,7 @@ void NTPLoginHandler::UpdateLogin() { // Chromeos does not show this status header. SigninManager* signin = SigninManagerFactory::GetForProfile( profile->GetOriginalProfile()); - if (!profile->IsManaged() && signin->IsSigninAllowed()) { + if (!profile->IsSupervised() && signin->IsSigninAllowed()) { base::string16 signed_in_link = l10n_util::GetStringUTF16( IDS_SYNC_PROMO_NOT_SIGNED_IN_STATUS_LINK); signed_in_link = CreateSpanWithClass(signed_in_link, "link-span"); diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index 93bfbcd..23b25f1 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc @@ -485,9 +485,9 @@ void NTPResourceCache::CreateNewTabHTML() { // feature is enabled. load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled", is_swipe_tracking_from_scroll_events_enabled_); - // Managed users can not have apps installed currently so there's no need to - // show the app cards. - if (profile_->IsManaged()) + // Supervised users can not have apps installed currently so there's no need + // to show the app cards. + if (profile_->IsSupervised()) should_show_apps_page_ = false; load_time_data.SetBoolean("showApps", should_show_apps_page_); diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index 970f4b9..4719798 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -569,7 +569,7 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) { values->Set("profilesInfo", GetProfilesInfoList().release()); values->SetBoolean("profileIsManaged", - Profile::FromWebUI(web_ui())->IsManaged()); + Profile::FromWebUI(web_ui())->IsSupervised()); #if !defined(OS_CHROMEOS) values->SetBoolean( @@ -825,7 +825,7 @@ void BrowserOptionsHandler::InitializeHandler() { base::Bind(&BrowserOptionsHandler::SetupFontSizeSelector, base::Unretained(this))); profile_pref_registrar_.Add( - prefs::kManagedUsers, + prefs::kSupervisedUsers, base::Bind(&BrowserOptionsHandler::SetupManagingSupervisedUsers, base::Unretained(this))); profile_pref_registrar_.Add( @@ -1224,7 +1224,7 @@ scoped_ptr<base::ListValue> BrowserOptionsHandler::GetProfilesInfoList() { profile_value->Set("filePath", base::CreateFilePathValue(profile_path)); profile_value->SetBoolean("isCurrentProfile", profile_path == current_profile_path); - profile_value->SetBoolean("isManaged", cache.ProfileIsManagedAtIndex(i)); + profile_value->SetBoolean("isManaged", cache.ProfileIsSupervisedAtIndex(i)); bool is_gaia_picture = cache.IsUsingGAIAPictureOfProfileAtIndex(i) && @@ -1271,10 +1271,10 @@ void BrowserOptionsHandler::ObserveThemeChanged() { bool is_system_theme = false; #if defined(OS_LINUX) && !defined(OS_CHROMEOS) - bool profile_is_managed = profile->IsManaged(); + bool profile_is_supervised = profile->IsSupervised(); is_system_theme = theme_service->UsingSystemTheme(); base::FundamentalValue native_theme_enabled(!is_system_theme && - !profile_is_managed); + !profile_is_supervised); web_ui()->CallJavascriptFunction("BrowserOptions.setNativeThemeButtonEnabled", native_theme_enabled); #endif @@ -1333,7 +1333,7 @@ BrowserOptionsHandler::GetSyncStateDictionary() { return sync_status.Pass(); } - sync_status->SetBoolean("supervisedUser", profile->IsManaged()); + sync_status->SetBoolean("supervisedUser", profile->IsSupervised()); bool signout_prohibited = false; #if !defined(OS_CHROMEOS) @@ -1739,7 +1739,7 @@ void BrowserOptionsHandler::SetupManageCertificatesSection() { void BrowserOptionsHandler::SetupManagingSupervisedUsers() { bool has_users = !Profile::FromWebUI(web_ui())-> - GetPrefs()->GetDictionary(prefs::kManagedUsers)->empty(); + GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); base::FundamentalValue has_users_value(has_users); web_ui()->CallJavascriptFunction( "BrowserOptions.updateManagesSupervisedUsers", diff --git a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc index 8161875..9599b89 100644 --- a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc +++ b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc @@ -140,7 +140,7 @@ void ClearBrowserDataHandler::GetLocalizedValues( } localized_strings->Set("clearBrowserDataTimeList", time_list); localized_strings->SetBoolean("showDeleteBrowsingHistoryCheckboxes", - !Profile::FromWebUI(web_ui())->IsManaged()); + !Profile::FromWebUI(web_ui())->IsSupervised()); } void ClearBrowserDataHandler::RegisterMessages() { diff --git a/chrome/browser/ui/webui/options/create_profile_handler.cc b/chrome/browser/ui/webui/options/create_profile_handler.cc index 0a33278..3d3cc3d 100644 --- a/chrome/browser/ui/webui/options/create_profile_handler.cc +++ b/chrome/browser/ui/webui/options/create_profile_handler.cc @@ -54,10 +54,11 @@ void CreateProfileHandler::RegisterMessages() { } void CreateProfileHandler::CreateProfile(const base::ListValue* args) { - // This handler could have been called in managed mode, for example because - // the user fiddled with the web inspector. Silently return in this case. + // This handler could have been called for a supervised user, for example + // because the user fiddled with the web inspector. Silently return in this + // case. Profile* current_profile = Profile::FromWebUI(web_ui()); - if (current_profile->IsManaged()) + if (current_profile->IsSupervised()) return; if (!profiles::IsMultipleProfilesEnabled()) @@ -76,26 +77,26 @@ void CreateProfileHandler::CreateProfile(const base::ListValue* args) { base::string16 name; base::string16 icon; - std::string managed_user_id; + std::string supervised_user_id; bool create_shortcut = false; - bool managed_user = false; + bool supervised_user = false; if (args->GetString(0, &name) && args->GetString(1, &icon)) { if (args->GetBoolean(2, &create_shortcut)) { - bool success = args->GetBoolean(3, &managed_user); + bool success = args->GetBoolean(3, &supervised_user); DCHECK(success); - success = args->GetString(4, &managed_user_id); + success = args->GetString(4, &supervised_user_id); DCHECK(success); } } - if (managed_user) { - if (!IsValidExistingManagedUserId(managed_user_id)) + if (supervised_user) { + if (!IsValidExistingSupervisedUserId(supervised_user_id)) return; profile_creation_type_ = SUPERVISED_PROFILE_IMPORT; - if (managed_user_id.empty()) { + if (supervised_user_id.empty()) { profile_creation_type_ = SUPERVISED_PROFILE_CREATION; - managed_user_id = + supervised_user_id = ManagedUserRegistrationUtility::GenerateNewManagedUserId(); // If sync is not yet fully initialized, the creation may take extra time, @@ -121,14 +122,14 @@ void CreateProfileHandler::CreateProfile(const base::ListValue* args) { weak_ptr_factory_.GetWeakPtr(), create_shortcut, helper::GetDesktopType(web_ui()), - managed_user_id), - managed_user_id); + supervised_user_id), + supervised_user_id); } void CreateProfileHandler::OnProfileCreated( bool create_shortcut, chrome::HostDesktopType desktop_type, - const std::string& managed_user_id, + const std::string& supervised_user_id, Profile* profile, Profile::CreateStatus status) { if (status != Profile::CREATE_STATUS_CREATED) @@ -146,14 +147,14 @@ void CreateProfileHandler::OnProfileCreated( } case Profile::CREATE_STATUS_INITIALIZED: { HandleProfileCreationSuccess(create_shortcut, desktop_type, - managed_user_id, profile); + supervised_user_id, profile); break; } // User-initiated cancellation is handled in CancelProfileRegistration and // does not call this callback. case Profile::CREATE_STATUS_CANCELED: - // Managed user registration errors are handled in - // OnManagedUserRegistered(). + // Supervised user registration errors are handled in + // OnSupervisedUserRegistered(). case Profile::CREATE_STATUS_REMOTE_FAIL: case Profile::MAX_CREATE_STATUS: { NOTREACHED(); @@ -165,18 +166,18 @@ void CreateProfileHandler::OnProfileCreated( void CreateProfileHandler::HandleProfileCreationSuccess( bool create_shortcut, chrome::HostDesktopType desktop_type, - const std::string& managed_user_id, + const std::string& supervised_user_id, Profile* profile) { switch (profile_creation_type_) { case NON_SUPERVISED_PROFILE_CREATION: { - DCHECK(managed_user_id.empty()); + DCHECK(supervised_user_id.empty()); CreateShortcutAndShowSuccess(create_shortcut, desktop_type, profile); break; } case SUPERVISED_PROFILE_CREATION: case SUPERVISED_PROFILE_IMPORT: - RegisterManagedUser(create_shortcut, desktop_type, - managed_user_id, profile); + RegisterSupervisedUser(create_shortcut, desktop_type, + supervised_user_id, profile); break; case NO_CREATION_IN_PROGRESS: NOTREACHED(); @@ -184,10 +185,10 @@ void CreateProfileHandler::HandleProfileCreationSuccess( } } -void CreateProfileHandler::RegisterManagedUser( +void CreateProfileHandler::RegisterSupervisedUser( bool create_shortcut, chrome::HostDesktopType desktop_type, - const std::string& managed_user_id, + const std::string& supervised_user_id, Profile* new_profile) { DCHECK_EQ(profile_path_being_created_.value(), new_profile->GetPath().value()); @@ -195,21 +196,21 @@ void CreateProfileHandler::RegisterManagedUser( ManagedUserService* managed_user_service = ManagedUserServiceFactory::GetForProfile(new_profile); - // Register the managed user using the profile of the custodian. + // Register the supervised user using the profile of the custodian. managed_user_registration_utility_ = ManagedUserRegistrationUtility::Create(Profile::FromWebUI(web_ui())); managed_user_service->RegisterAndInitSync( managed_user_registration_utility_.get(), Profile::FromWebUI(web_ui()), - managed_user_id, - base::Bind(&CreateProfileHandler::OnManagedUserRegistered, + supervised_user_id, + base::Bind(&CreateProfileHandler::OnSupervisedUserRegistered, weak_ptr_factory_.GetWeakPtr(), create_shortcut, desktop_type, new_profile)); } -void CreateProfileHandler::OnManagedUserRegistered( +void CreateProfileHandler::OnSupervisedUserRegistered( bool create_shortcut, chrome::HostDesktopType desktop_type, Profile* profile, @@ -252,10 +253,10 @@ void CreateProfileHandler::CreateShortcutAndShowSuccess( dict.SetString("name", profile->GetPrefs()->GetString(prefs::kProfileName)); dict.Set("filePath", base::CreateFilePathValue(profile->GetPath())); - bool is_managed = + bool is_supervised = profile_creation_type_ == SUPERVISED_PROFILE_CREATION || profile_creation_type_ == SUPERVISED_PROFILE_IMPORT; - dict.SetBoolean("isManaged", is_managed); + dict.SetBoolean("isManaged", is_supervised); web_ui()->CallJavascriptFunction( GetJavascriptMethodName(PROFILE_CREATION_SUCCESS), dict); @@ -307,10 +308,10 @@ void CreateProfileHandler::CancelProfileRegistration(bool user_initiated) { if (!new_profile) return; - // Non-managed user creation cannot be canceled. (Creating a non-managed + // Non-supervised user creation cannot be canceled. (Creating a non-supervised // profile shouldn't take significant time, and it can easily be deleted // afterward.) - if (!new_profile->IsManaged()) + if (!new_profile->IsSupervised()) return; if (user_initiated) { @@ -406,22 +407,23 @@ std::string CreateProfileHandler::GetJavascriptMethodName( return std::string(); } -bool CreateProfileHandler::IsValidExistingManagedUserId( - const std::string& existing_managed_user_id) const { - if (existing_managed_user_id.empty()) +bool CreateProfileHandler::IsValidExistingSupervisedUserId( + const std::string& existing_supervised_user_id) const { + if (existing_supervised_user_id.empty()) return true; Profile* profile = Profile::FromWebUI(web_ui()); const base::DictionaryValue* dict = ManagedUserSyncServiceFactory::GetForProfile(profile)->GetManagedUsers(); - if (!dict->HasKey(existing_managed_user_id)) + if (!dict->HasKey(existing_supervised_user_id)) return false; - // Check if this managed user already exists on this machine. + // Check if this supervised user already exists on this machine. const ProfileInfoCache& cache = g_browser_process->profile_manager()->GetProfileInfoCache(); for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { - if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i)) + if (existing_supervised_user_id == + cache.GetSupervisedUserIdOfProfileAtIndex(i)) return false; } return true; diff --git a/chrome/browser/ui/webui/options/create_profile_handler.h b/chrome/browser/ui/webui/options/create_profile_handler.h index 2c25b71..e813b39 100644 --- a/chrome/browser/ui/webui/options/create_profile_handler.h +++ b/chrome/browser/ui/webui/options/create_profile_handler.h @@ -69,8 +69,9 @@ class CreateProfileHandler: public OptionsPageUIHandler { // 1: icon (string) // 2: a flag stating whether we should create a profile desktop shortcut // (optional, boolean) - // 3: a flag stating whether the user should be managed (optional, boolean) - // 4: a string representing the managed user ID. + // 3: a flag stating whether the user should be supervised + // (optional, boolean) + // 4: a string representing the supervised user ID. void CreateProfile(const base::ListValue* args); // If a local error occurs during profile creation, then show an appropriate @@ -80,27 +81,27 @@ class CreateProfileHandler: public OptionsPageUIHandler { // as the final task after a new profile has been created. void OnProfileCreated(bool create_shortcut, chrome::HostDesktopType desktop_type, - const std::string& managed_user_id, + const std::string& supervised_user_id, Profile* profile, Profile::CreateStatus status); void HandleProfileCreationSuccess(bool create_shortcut, chrome::HostDesktopType desktop_type, - const std::string& managed_user_id, + const std::string& supervised_user_id, Profile* profile); - // After a new managed-user profile has been created, registers the user with - // the management server. - void RegisterManagedUser(bool create_shortcut, - chrome::HostDesktopType desktop_type, - const std::string& managed_user_id, - Profile* new_profile); + // After a new supervised-user profile has been created, registers the user + // with the management server. + void RegisterSupervisedUser(bool create_shortcut, + chrome::HostDesktopType desktop_type, + const std::string& managed_user_id, + Profile* new_profile); - // Called back with the result of the managed user registration. - void OnManagedUserRegistered(bool create_shortcut, - chrome::HostDesktopType desktop_type, - Profile* profile, - const GoogleServiceAuthError& error); + // Called back with the result of the supervised user registration. + void OnSupervisedUserRegistered(bool create_shortcut, + chrome::HostDesktopType desktop_type, + Profile* profile, + const GoogleServiceAuthError& error); // Creates desktop shortcut and updates the UI to indicate success // when creating a profile. @@ -114,9 +115,9 @@ class CreateProfileHandler: public OptionsPageUIHandler { // Updates the UI to show a non-fatal warning when creating a profile. void ShowProfileCreationWarning(const base::string16& warning); - // Cancels creation of a managed-user profile currently in progress, as + // Cancels creation of a supervised-user profile currently in progress, as // indicated by profile_path_being_created_, removing the object and files - // and canceling managed-user registration. This is the handler for the + // and canceling supervised-user registration. This is the handler for the // "cancelCreateProfile" message. |args| is not used. void HandleCancelProfileCreation(const base::ListValue* args); @@ -138,10 +139,10 @@ class CreateProfileHandler: public OptionsPageUIHandler { ProfileCreationErrorType error) const; std::string GetJavascriptMethodName(ProfileCreationStatus status) const; - bool IsValidExistingManagedUserId( - const std::string& existing_managed_user_id) const; + bool IsValidExistingSupervisedUserId( + const std::string& existing_supervised_user_id) const; - // Used to allow cancelling a profile creation (particularly a managed-user + // Used to allow cancelling a profile creation (particularly a supervised-user // registration) in progress. Set when profile creation is begun, and // cleared when all the callbacks have been run and creation is complete. base::FilePath profile_path_being_created_; diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.cc b/chrome/browser/ui/webui/options/manage_profile_handler.cc index d25446a..61e1e4d 100644 --- a/chrome/browser/ui/webui/options/manage_profile_handler.cc +++ b/chrome/browser/ui/webui/options/manage_profile_handler.cc @@ -137,8 +137,8 @@ void ManageProfileHandler::InitializeHandler() { Profile* profile = Profile::FromWebUI(web_ui()); pref_change_registrar_.Init(profile->GetPrefs()); pref_change_registrar_.Add( - prefs::kManagedUserCreationAllowed, - base::Bind(&ManageProfileHandler::OnCreateManagedUserPrefChange, + prefs::kSupervisedUserCreationAllowed, + base::Bind(&ManageProfileHandler::OnCreateSupervisedUserPrefChange, base::Unretained(this))); ProfileSyncService* service = ProfileSyncServiceFactory::GetForProfile(profile); @@ -149,7 +149,7 @@ void ManageProfileHandler::InitializeHandler() { void ManageProfileHandler::InitializePage() { SendExistingProfileNames(); - OnCreateManagedUserPrefChange(); + OnCreateSupervisedUserPrefChange(); } void ManageProfileHandler::RegisterMessages() { @@ -358,7 +358,7 @@ void ManageProfileHandler::SetProfileIconAndName(const base::ListValue* args) { } ProfileMetrics::LogProfileUpdate(profile_file_path); - if (profile->IsManaged()) + if (profile->IsSupervised()) return; base::string16 new_profile_name; @@ -472,13 +472,13 @@ void ManageProfileHandler::RequestCreateProfileUpdate( GenerateSignedinUserSpecificStrings(&replacements); web_ui()->CallJavascriptFunction("loadTimeData.overrideValues", replacements); - OnCreateManagedUserPrefChange(); + OnCreateSupervisedUserPrefChange(); } -void ManageProfileHandler::OnCreateManagedUserPrefChange() { +void ManageProfileHandler::OnCreateSupervisedUserPrefChange() { PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); base::FundamentalValue allowed( - prefs->GetBoolean(prefs::kManagedUserCreationAllowed)); + prefs->GetBoolean(prefs::kSupervisedUserCreationAllowed)); web_ui()->CallJavascriptFunction( "CreateProfileOverlay.updateManagedUsersAllowed", allowed); } diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.h b/chrome/browser/ui/webui/options/manage_profile_handler.h index b4ef986..d004ec7 100644 --- a/chrome/browser/ui/webui/options/manage_profile_handler.h +++ b/chrome/browser/ui/webui/options/manage_profile_handler.h @@ -100,13 +100,13 @@ class ManageProfileHandler : public OptionsPageUIHandler, // Callback for the "RequestCreateProfileUpdate" message. // Sends the email address of the signed-in user, or an empty string if the - // user is not signed in. Also sends information about whether managed users - // may be created. + // user is not signed in. Also sends information about whether supervised + // users may be created. void RequestCreateProfileUpdate(const base::ListValue* args); - // When the pref allowing managed-user creation changes, sends the new value - // to the UI. - void OnCreateManagedUserPrefChange(); + // When the pref allowing supervised-user creation changes, sends the new + // value to the UI. + void OnCreateSupervisedUserPrefChange(); // Callback invoked from the profile manager indicating whether the profile // being edited has any desktop shortcuts. @@ -129,7 +129,7 @@ class ManageProfileHandler : public OptionsPageUIHandler, // URL for the current profile's GAIA picture. std::string gaia_picture_url_; - // Used to observe the preference that allows creating managed users, which + // Used to observe the preference that allows creating supervised users, which // can be changed by policy. PrefChangeRegistrar pref_change_registrar_; diff --git a/chrome/browser/ui/webui/options/managed_user_import_handler.cc b/chrome/browser/ui/webui/options/managed_user_import_handler.cc index c19021b..34064e2 100644 --- a/chrome/browser/ui/webui/options/managed_user_import_handler.cc +++ b/chrome/browser/ui/webui/options/managed_user_import_handler.cc @@ -53,7 +53,7 @@ ManagedUserImportHandler::ManagedUserImportHandler() ManagedUserImportHandler::~ManagedUserImportHandler() { Profile* profile = Profile::FromWebUI(web_ui()); - if (!profile->IsManaged()) { + if (!profile->IsSupervised()) { ManagedUserSyncService* service = ManagedUserSyncServiceFactory::GetForProfile(profile); if (service) @@ -86,7 +86,7 @@ void ManagedUserImportHandler::GetLocalizedValues( void ManagedUserImportHandler::InitializeHandler() { Profile* profile = Profile::FromWebUI(web_ui()); - if (!profile->IsManaged()) { + if (!profile->IsSupervised()) { ManagedUserSyncService* sync_service = ManagedUserSyncServiceFactory::GetForProfile(profile); if (sync_service) { @@ -124,7 +124,7 @@ void ManagedUserImportHandler::FetchManagedUsers() { void ManagedUserImportHandler::RequestManagedUserImportUpdate( const base::ListValue* /* args */) { - if (Profile::FromWebUI(web_ui())->IsManaged()) + if (Profile::FromWebUI(web_ui())->IsSupervised()) return; if (!IsAccountConnected() || HasAuthError()) { @@ -150,8 +150,8 @@ void ManagedUserImportHandler::SendExistingManagedUsers( // Collect the ids of local supervised user profiles. std::set<std::string> managed_user_ids; for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { - if (cache.ProfileIsManagedAtIndex(i)) - managed_user_ids.insert(cache.GetManagedUserIdOfProfileAtIndex(i)); + if (cache.ProfileIsSupervisedAtIndex(i)) + managed_user_ids.insert(cache.GetSupervisedUserIdOfProfileAtIndex(i)); } base::ListValue managed_users; diff --git a/chrome/browser/ui/webui/options/options_handlers_helper.cc b/chrome/browser/ui/webui/options/options_handlers_helper.cc index 3f43637..6bb1192 100644 --- a/chrome/browser/ui/webui/options/options_handlers_helper.cc +++ b/chrome/browser/ui/webui/options/options_handlers_helper.cc @@ -51,9 +51,10 @@ void OpenNewWindowForProfile(chrome::HostDesktopType desktop_type, void DeleteProfileAtPath(base::FilePath file_path, content::WebUI* web_ui) { DCHECK(web_ui); - // This handler could have been called in managed mode, for example because - // the user fiddled with the web inspector. Silently return in this case. - if (Profile::FromWebUI(web_ui)->IsManaged()) + // This handler could have been called for a supervised user, for example + // because the user fiddled with the web inspector. Silently return in this + // case. + if (Profile::FromWebUI(web_ui)->IsSupervised()) return; if (!profiles::IsMultipleProfilesEnabled()) diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc index 2274e50..51e5774 100644 --- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc +++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc @@ -345,9 +345,10 @@ void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) { if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) return; - // This handler could have been called in managed mode, for example because - // the user fiddled with the web inspector. Silently return in this case. - if (Profile::FromWebUI(web_ui())->IsManaged()) + // This handler could have been called for a supervised user, for example + // because the user fiddled with the web inspector. Silently return in this + // case. + if (Profile::FromWebUI(web_ui())->IsSupervised()) return; if (!profiles::IsMultipleProfilesEnabled()) @@ -576,9 +577,9 @@ void UserManagerScreenHandler::SendUserList() { user_auth_type_map_.clear(); - // If the active user is a managed user, then they may not perform + // If the active user is a supervised user, then they may not perform // certain actions (i.e. delete another user). - bool active_user_is_managed = Profile::FromWebUI(web_ui())->IsManaged(); + bool active_user_is_supervised = Profile::FromWebUI(web_ui())->IsSupervised(); for (size_t i = 0; i < info_cache.GetNumberOfProfiles(); ++i) { base::DictionaryValue* profile_value = new base::DictionaryValue(); @@ -594,12 +595,12 @@ void UserManagerScreenHandler::SendUserList() { profile_value->SetString(kKeyProfilePath, profile_path.MaybeAsASCII()); profile_value->SetBoolean(kKeyPublicAccount, false); profile_value->SetBoolean( - kKeyLocallyManagedUser, info_cache.ProfileIsManagedAtIndex(i)); + kKeyLocallyManagedUser, info_cache.ProfileIsSupervisedAtIndex(i)); profile_value->SetBoolean(kKeySignedIn, is_active_user); profile_value->SetBoolean( kKeyNeedsSignin, info_cache.ProfileIsSigninRequiredAtIndex(i)); profile_value->SetBoolean(kKeyIsOwner, false); - profile_value->SetBoolean(kKeyCanRemove, !active_user_is_managed); + profile_value->SetBoolean(kKeyCanRemove, !active_user_is_supervised); profile_value->SetBoolean(kKeyIsDesktop, true); profile_value->SetString( kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache)); diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index e412a9c..839495f 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -171,7 +171,7 @@ const base::FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons"); const base::FilePath::CharType kLocalStateFilename[] = FPL("Local State"); const base::FilePath::CharType kLocalStorePoolName[] = FPL("LocalStorePool"); const base::FilePath::CharType kLoginDataFileName[] = FPL("Login Data"); -const base::FilePath::CharType kManagedUserSettingsFilename[] = +const base::FilePath::CharType kSupervisedUserSettingsFilename[] = FPL("Managed Mode Settings"); const base::FilePath::CharType kMediaCacheDirname[] = FPL("Media Cache"); const base::FilePath::CharType kNewTabThumbnailsFilename[] = diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index cd038b1..4b796f1 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -71,7 +71,7 @@ extern const base::FilePath::CharType kJumpListIconDirname[]; extern const base::FilePath::CharType kLocalStateFilename[]; extern const base::FilePath::CharType kLocalStorePoolName[]; extern const base::FilePath::CharType kLoginDataFileName[]; -extern const base::FilePath::CharType kManagedUserSettingsFilename[]; +extern const base::FilePath::CharType kSupervisedUserSettingsFilename[]; extern const base::FilePath::CharType kMediaCacheDirname[]; extern const base::FilePath::CharType kNewTabThumbnailsFilename[]; extern const base::FilePath::CharType kOBCertFilename[]; diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 52f42fe..3fef012 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -435,7 +435,7 @@ bool PathProvider(int key, base::FilePath* result) { break; #endif #if defined(OS_LINUX) && defined(ENABLE_MANAGED_USERS) - case chrome::DIR_MANAGED_USERS_DEFAULT_APPS: + case chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS: if (!PathService::Get(chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS, &cur)) return false; cur = cur.Append(FILE_PATH_LITERAL("managed_users")); diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index d436f8e..135b876 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h @@ -112,9 +112,9 @@ enum { DIR_CHROMEOS_CUSTOM_WALLPAPERS, // Directory where custom wallpapers // reside. #endif - DIR_MANAGED_USERS_DEFAULT_APPS, // Directory where installer places .crx - // files to be installed when managed user - // session starts. + DIR_SUPERVISED_USERS_DEFAULT_APPS, // Directory where installer places .crx + // files to be installed when managed user + // session starts. #if defined(OS_LINUX) || (defined(OS_MACOSX) && !defined(OS_IOS)) DIR_NATIVE_MESSAGING, // System directory where native messaging host // manifest files are stored. diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index ed7586c..f5c1391 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -805,14 +805,14 @@ const char kMalwareInterstitialVersionV3[] = "malware-interstitial-v3"; // Makes Chrome default browser const char kMakeDefaultBrowser[] = "make-default-browser"; -// Sets the managed user ID for any loaded or newly created profile to the +// Sets the supervised user ID for any loaded or newly created profile to the // given value. Pass an empty string to mark the profile as non-supervised. // Used for testing. -const char kManagedUserId[] = "managed-user-id"; +const char kSupervisedUserId[] = "managed-user-id"; -// Used to authenticate requests to the Sync service for managed users. Setting -// this switch also causes Sync to be set up for a managed user. -const char kManagedUserSyncToken[] = "managed-user-sync-token"; +// Used to authenticate requests to the Sync service for supervised users. +// Setting this switch also causes Sync to be set up for a supervised user. +const char kSupervisedUserSyncToken[] = "managed-user-sync-token"; // Use to opt-in user into Finch experiment groups. const char kManualEnhancedBookmarks[] = "manual-enhanced-bookmarks"; @@ -889,7 +889,7 @@ const char kNoStartupWindow[] = "no-startup-window"; // a supervised user. Also disables the timeout during registration that waits // for the ack. Useful when debugging against a server that does not // support notifications. -const char kNoManagedUserAcknowledgmentCheck[] = +const char kNoSupervisedUserAcknowledgmentCheck[] = "no-managed-user-acknowledgment-check"; // Specifies the maximum number of threads to use for running the Proxy diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 7d47a43..41aaa91 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -147,7 +147,6 @@ extern const char kEnableExtensionActivityLogTesting[]; extern const char kEnableFastUnload[]; extern const char kEnableIPv6[]; extern const char kEnableLinkableEphemeralApps[]; -extern const char kEnableManagedStorage[]; extern const char kEnableNaCl[]; extern const char kEnableNetBenchmarking[]; extern const char kEnableNpnHttpOnly[]; @@ -229,8 +228,8 @@ extern const char kLoadExtension[]; extern const char kMalwareInterstitialVersionV2[]; extern const char kMalwareInterstitialVersionV3[]; extern const char kMakeDefaultBrowser[]; -extern const char kManagedUserId[]; -extern const char kManagedUserSyncToken[]; +extern const char kSupervisedUserId[]; +extern const char kSupervisedUserSyncToken[]; extern const char kManualEnhancedBookmarks[]; extern const char kManualEnhancedBookmarksOptout[]; extern const char kMediaCacheSize[]; @@ -248,7 +247,7 @@ extern const char kNoProxyServer[]; extern const char kNoPings[]; extern const char kNoServiceAutorun[]; extern const char kNoStartupWindow[]; -extern const char kNoManagedUserAcknowledgmentCheck[]; +extern const char kNoSupervisedUserAcknowledgmentCheck[]; extern const char kNtpAppInstallHint[]; extern const char kNumPacThreads[]; extern const char kOpenInNewWindow[]; diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index edf2729..f400a8a 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -34,23 +34,23 @@ const char kHomePageIsNewTabPage[] = "homepage_is_newtabpage"; const char kHomePage[] = "homepage"; // Maps host names to whether the host is manually allowed or blocked. -const char kManagedModeManualHosts[] = "profile.managed.manual_hosts"; +const char kSupervisedUserManualHosts[] = "profile.managed.manual_hosts"; // Maps URLs to whether the URL is manually allowed or blocked. -const char kManagedModeManualURLs[] = "profile.managed.manual_urls"; +const char kSupervisedUserManualURLs[] = "profile.managed.manual_urls"; // Stores the email address associated with the google account of the custodian -// of the managed user, set when the managed user is created. -const char kManagedUserCustodianEmail[] = "profile.managed.custodian_email"; +// of the supervised user, set when the supervised user is created. +const char kSupervisedUserCustodianEmail[] = "profile.managed.custodian_email"; // Stores the display name associated with the google account of the custodian -// of the managed user, updated (if possible) each time the managed user +// of the supervised user, updated (if possible) each time the supervised user // starts a session. -const char kManagedUserCustodianName[] = "profile.managed.custodian_name"; +const char kSupervisedUserCustodianName[] = "profile.managed.custodian_name"; // Stores settings that can be modified both by a supervised user and their // manager. See ManagedUserSharedSettingsService for a description of // the format. -const char kManagedUserSharedSettings[] = "profile.managed.shared_settings"; +const char kSupervisedUserSharedSettings[] = "profile.managed.shared_settings"; // An integer that keeps track of the profile icon version. This allows us to // determine the state of the profile icon for icon format changes. @@ -1171,11 +1171,11 @@ const char kImportSavedPasswords[] = "import_saved_passwords"; const char kProfileAvatarIndex[] = "profile.avatar_index"; const char kProfileName[] = "profile.name"; -// Whether the profile is managed. -const char kProfileIsManaged[] = "profile.is_managed"; +// Whether the profile is supervised. Deprecated, use kSupervisedUserId below. +const char kProfileIsSupervised[] = "profile.is_managed"; -// The managed user ID. -const char kManagedUserId[] = "profile.managed_user_id"; +// The supervised user ID. +const char kSupervisedUserId[] = "profile.managed_user_id"; // 64-bit integer serialization of the base::Time when the user's GAIA info // was last updated. @@ -1209,15 +1209,15 @@ const char kPrintPreviewDisabled[] = "printing.print_preview_disabled"; // 0: Allow (does nothing) // 1: Warn. // 2: Block. -const char kDefaultManagedModeFilteringBehavior[] = +const char kDefaultSupervisedUserFilteringBehavior[] = "profile.managed.default_filtering_behavior"; -// Whether this user is permitted to create managed users. -const char kManagedUserCreationAllowed[] = +// Whether this user is permitted to create supervised users. +const char kSupervisedUserCreationAllowed[] = "profile.managed_user_creation_allowed"; -// List pref containing the users managed by this user. -const char kManagedUsers[] = "profile.managed_users"; +// List pref containing the users supervised by this user. +const char kSupervisedUsers[] = "profile.managed_users"; // List pref containing the extension ids which are not allowed to send // notifications to the message center. diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index a44fdbf..c71d9a4 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -25,11 +25,11 @@ extern const char kDefaultAppsInstalled[]; extern const char kDisableScreenshots[]; extern const char kHomePageIsNewTabPage[]; extern const char kHomePage[]; -extern const char kManagedModeManualHosts[]; -extern const char kManagedModeManualURLs[]; -extern const char kManagedUserCustodianEmail[]; -extern const char kManagedUserCustodianName[]; -extern const char kManagedUserSharedSettings[]; +extern const char kSupervisedUserManualHosts[]; +extern const char kSupervisedUserManualURLs[]; +extern const char kSupervisedUserCustodianEmail[]; +extern const char kSupervisedUserCustodianName[]; +extern const char kSupervisedUserSharedSettings[]; extern const char kProfileIconVersion[]; extern const char kRestoreOnStartup[]; extern const char kRestoreOnStartupMigrated[]; @@ -368,8 +368,8 @@ extern const char kImportSavedPasswords[]; extern const char kProfileAvatarIndex[]; extern const char kProfileName[]; -extern const char kProfileIsManaged[]; -extern const char kManagedUserId[]; +extern const char kProfileIsSupervised[]; +extern const char kSupervisedUserId[]; extern const char kProfileGAIAInfoUpdateTime[]; extern const char kProfileGAIAInfoPictureURL[]; @@ -382,10 +382,10 @@ extern const char kInvertNotificationShown[]; extern const char kPrintingEnabled[]; extern const char kPrintPreviewDisabled[]; -extern const char kDefaultManagedModeFilteringBehavior[]; +extern const char kDefaultSupervisedUserFilteringBehavior[]; -extern const char kManagedUserCreationAllowed[]; -extern const char kManagedUsers[]; +extern const char kSupervisedUserCreationAllowed[]; +extern const char kSupervisedUsers[]; extern const char kMessageCenterDisabledExtensionIds[]; extern const char kMessageCenterDisabledSystemComponentIds[]; diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index 690a4b1..8556201 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -320,7 +320,7 @@ const char kExtensionsSubPage[] = "extensions"; const char kHandlerSettingsSubPage[] = "handlers"; const char kImportDataSubPage[] = "importData"; const char kLanguageOptionsSubPage[] = "languages"; -const char kManagedUserSettingsSubPage[] = "managedUser"; +const char kSupervisedUserSettingsSubPage[] = "managedUser"; const char kManageProfileSubPage[] = "manageProfile"; const char kPasswordManagerSubPage[] = "passwords"; const char kResetProfileSettingsSubPage[] = "resetProfileSettings"; diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index cba024e..c330355 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -308,7 +308,7 @@ extern const char kExtensionsSubPage[]; extern const char kHandlerSettingsSubPage[]; extern const char kImportDataSubPage[]; extern const char kLanguageOptionsSubPage[]; -extern const char kManagedUserSettingsSubPage[]; +extern const char kSupervisedUserSettingsSubPage[]; extern const char kManageProfileSubPage[]; extern const char kPasswordManagerSubPage[]; extern const char kResetProfileSettingsSubPage[]; diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 0204523..04c63ab 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -246,7 +246,7 @@ TestingProfile::TestingProfile( scoped_ptr<PrefServiceSyncable> prefs, bool incognito, bool guest_session, - const std::string& managed_user_id, + const std::string& supervised_user_id, scoped_ptr<policy::PolicyService> policy_service, const TestingFactories& factories) : start_time_(Time::Now()), @@ -256,7 +256,7 @@ TestingProfile::TestingProfile( force_incognito_(false), original_profile_(NULL), guest_session_(guest_session), - managed_user_id_(managed_user_id), + supervised_user_id_(supervised_user_id), last_session_exited_cleanly_(true), extension_special_storage_policy_(extension_policy), profile_path_(path), @@ -637,8 +637,8 @@ Profile* TestingProfile::GetOriginalProfile() { return this; } -bool TestingProfile::IsManaged() { - return !managed_user_id_.empty(); +bool TestingProfile::IsSupervised() { + return !supervised_user_id_.empty(); } ExtensionService* TestingProfile::GetExtensionService() { @@ -959,9 +959,9 @@ void TestingProfile::Builder::SetGuestSession() { guest_session_ = true; } -void TestingProfile::Builder::SetManagedUserId( - const std::string& managed_user_id) { - managed_user_id_ = managed_user_id; +void TestingProfile::Builder::SetSupervisedUserId( + const std::string& supervised_user_id) { + supervised_user_id_ = supervised_user_id; } void TestingProfile::Builder::SetPolicyService( @@ -986,7 +986,7 @@ scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { pref_service_.Pass(), incognito_, guest_session_, - managed_user_id_, + supervised_user_id_, policy_service_.Pass(), testing_factories_)); } diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h index d573cf1..69a3c93 100644 --- a/chrome/test/base/testing_profile.h +++ b/chrome/test/base/testing_profile.h @@ -100,9 +100,9 @@ class TestingProfile : public Profile { // Makes the Profile being built a guest profile. void SetGuestSession(); - // Sets the managed user ID (which is empty by default). If it is set to a - // non-empty string, the profile is managed. - void SetManagedUserId(const std::string& managed_user_id); + // Sets the supervised user ID (which is empty by default). If it is set to + // a non-empty string, the profile is supervised. + void SetSupervisedUserId(const std::string& supervised_user_id); // Sets the PolicyService to be used by this profile. void SetPolicyService(scoped_ptr<policy::PolicyService> policy_service); @@ -121,7 +121,7 @@ class TestingProfile : public Profile { Delegate* delegate_; bool incognito_; bool guest_session_; - std::string managed_user_id_; + std::string supervised_user_id_; scoped_ptr<policy::PolicyService> policy_service_; TestingFactories testing_factories_; @@ -149,7 +149,7 @@ class TestingProfile : public Profile { scoped_ptr<PrefServiceSyncable> prefs, bool incognito, bool guest_session, - const std::string& managed_user_id, + const std::string& supervised_user_id, scoped_ptr<policy::PolicyService> policy_service, const TestingFactories& factories); @@ -250,7 +250,7 @@ class TestingProfile : public Profile { virtual void DestroyOffTheRecordProfile() OVERRIDE {} virtual bool HasOffTheRecordProfile() OVERRIDE; virtual Profile* GetOriginalProfile() OVERRIDE; - virtual bool IsManaged() OVERRIDE; + virtual bool IsSupervised() OVERRIDE; virtual ExtensionService* GetExtensionService() OVERRIDE; void SetExtensionSpecialStoragePolicy( ExtensionSpecialStoragePolicy* extension_special_storage_policy); @@ -381,7 +381,7 @@ class TestingProfile : public Profile { bool guest_session_; - std::string managed_user_id_; + std::string supervised_user_id_; // Did the last session exit cleanly? Default is true. bool last_session_exited_cleanly_; diff --git a/chrome/test/base/testing_profile_manager.cc b/chrome/test/base/testing_profile_manager.cc index cd3eb5d..6bd4aba 100644 --- a/chrome/test/base/testing_profile_manager.cc +++ b/chrome/test/base/testing_profile_manager.cc @@ -53,7 +53,7 @@ TestingProfile* TestingProfileManager::CreateTestingProfile( scoped_ptr<PrefServiceSyncable> prefs, const base::string16& user_name, int avatar_id, - const std::string& managed_user_id, + const std::string& supervised_user_id, const TestingProfile::TestingFactories& factories) { DCHECK(called_set_up_); @@ -65,7 +65,7 @@ TestingProfile* TestingProfileManager::CreateTestingProfile( TestingProfile::Builder builder; builder.SetPath(profile_path); builder.SetPrefService(prefs.Pass()); - builder.SetManagedUserId(managed_user_id); + builder.SetSupervisedUserId(supervised_user_id); for (TestingProfile::TestingFactories::const_iterator it = factories.begin(); it != factories.end(); ++it) { @@ -80,7 +80,7 @@ TestingProfile* TestingProfileManager::CreateTestingProfile( ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache(); size_t index = cache.GetIndexOfProfileWithPath(profile_path); cache.SetAvatarIconOfProfileAtIndex(index, avatar_id); - cache.SetManagedUserIdOfProfileAtIndex(index, managed_user_id); + cache.SetSupervisedUserIdOfProfileAtIndex(index, supervised_user_id); // SetNameOfProfileAtIndex may reshuffle the list of profiles, so we do it // last. cache.SetNameOfProfileAtIndex(index, user_name); diff --git a/chrome/test/base/testing_profile_manager.h b/chrome/test/base/testing_profile_manager.h index b4c1dda..a1e9f2e 100644 --- a/chrome/test/base/testing_profile_manager.h +++ b/chrome/test/base/testing_profile_manager.h @@ -44,7 +44,7 @@ class TestingProfileManager { // profile_name, which is a non-user-visible key for the test environment. // |prefs| is the PrefService used by the profile. If it is NULL, the profile // creates a PrefService on demand. - // |user_name|, |avatar_id| and |managed_user_id| are passed along to the + // |user_name|, |avatar_id| and |supervised_user_id| are passed along to the // ProfileInfoCache and provide the user-visible profile metadata. This will // register the TestingProfile with the profile subsystem as well. The // subsystem owns the Profile and returns a weak pointer. @@ -54,7 +54,7 @@ class TestingProfileManager { scoped_ptr<PrefServiceSyncable> prefs, const base::string16& user_name, int avatar_id, - const std::string& managed_user_id, + const std::string& supervised_user_id, const TestingProfile::TestingFactories& factories); // Small helper for creating testing profiles. Just forwards to above. diff --git a/components/sync_driver/model_association_manager.cc b/components/sync_driver/model_association_manager.cc index a66372f..57a8a28 100644 --- a/components/sync_driver/model_association_manager.cc +++ b/components/sync_driver/model_association_manager.cc @@ -39,9 +39,9 @@ static const syncer::ModelType kStartOrder[] = { // UI thread data types. syncer::BOOKMARKS, - syncer::MANAGED_USERS, // Syncing managed users on initial login might - // block creating a new managed user, so we - // want to do it early. + syncer::SUPERVISED_USERS, // Syncing supervised users on initial login + // might block creating a new supervised user, + // so we want to do it early. syncer::PREFERENCES, syncer::PRIORITY_PREFERENCES, syncer::EXTENSIONS, @@ -54,8 +54,8 @@ static const syncer::ModelType kStartOrder[] = { syncer::DICTIONARY, syncer::FAVICON_IMAGES, syncer::FAVICON_TRACKING, - syncer::MANAGED_USER_SETTINGS, - syncer::MANAGED_USER_SHARED_SETTINGS, + syncer::SUPERVISED_USER_SETTINGS, + syncer::SUPERVISED_USER_SHARED_SETTINGS, syncer::ARTICLES, }; diff --git a/components/sync_driver/pref_names.cc b/components/sync_driver/pref_names.cc index c542c64..e4e0373 100644 --- a/components/sync_driver/pref_names.cc +++ b/components/sync_driver/pref_names.cc @@ -43,10 +43,10 @@ const char kSyncExtensions[] = "sync.extensions"; const char kSyncFaviconImages[] = "sync.favicon_images"; const char kSyncFaviconTracking[] = "sync.favicon_tracking"; const char kSyncHistoryDeleteDirectives[] = "sync.history_delete_directives"; -const char kSyncManagedUserSettings[] = "sync.managed_user_settings"; -const char kSyncManagedUserSharedSettings[] = +const char kSyncSupervisedUserSettings[] = "sync.managed_user_settings"; +const char kSyncSupervisedUserSharedSettings[] = "sync.managed_user_shared_settings"; -const char kSyncManagedUsers[] = "sync.managed_users"; +const char kSyncSupervisedUsers[] = "sync.managed_users"; const char kSyncArticles[] = "sync.articles"; const char kSyncPasswords[] = "sync.passwords"; const char kSyncPreferences[] = "sync.preferences"; diff --git a/components/sync_driver/pref_names.h b/components/sync_driver/pref_names.h index d7e8f80..8b580da 100644 --- a/components/sync_driver/pref_names.h +++ b/components/sync_driver/pref_names.h @@ -31,9 +31,9 @@ extern const char kSyncExtensions[]; extern const char kSyncFaviconImages[]; extern const char kSyncFaviconTracking[]; extern const char kSyncHistoryDeleteDirectives[]; -extern const char kSyncManagedUserSettings[]; -extern const char kSyncManagedUserSharedSettings[]; -extern const char kSyncManagedUsers[]; +extern const char kSyncSupervisedUserSettings[]; +extern const char kSyncSupervisedUserSharedSettings[]; +extern const char kSyncSupervisedUsers[]; extern const char kSyncArticles[]; extern const char kSyncPasswords[]; extern const char kSyncPreferences[]; diff --git a/components/sync_driver/sync_prefs.cc b/components/sync_driver/sync_prefs.cc index 2a9f590..8e63e20 100644 --- a/components/sync_driver/sync_prefs.cc +++ b/components/sync_driver/sync_prefs.cc @@ -330,18 +330,18 @@ const char* SyncPrefs::GetPrefNameForDataType(syncer::ModelType data_type) { return prefs::kSyncFaviconImages; case syncer::FAVICON_TRACKING: return prefs::kSyncFaviconTracking; - case syncer::MANAGED_USER_SETTINGS: - return prefs::kSyncManagedUserSettings; + case syncer::SUPERVISED_USER_SETTINGS: + return prefs::kSyncSupervisedUserSettings; case syncer::PROXY_TABS: return prefs::kSyncTabs; case syncer::PRIORITY_PREFERENCES: return prefs::kSyncPriorityPreferences; - case syncer::MANAGED_USERS: - return prefs::kSyncManagedUsers; + case syncer::SUPERVISED_USERS: + return prefs::kSyncSupervisedUsers; case syncer::ARTICLES: return prefs::kSyncArticles; - case syncer::MANAGED_USER_SHARED_SETTINGS: - return prefs::kSyncManagedUserSharedSettings; + case syncer::SUPERVISED_USER_SHARED_SETTINGS: + return prefs::kSyncSupervisedUserSharedSettings; default: break; } @@ -423,7 +423,7 @@ void SyncPrefs::RegisterPrefGroups() { pref_groups_[syncer::PROXY_TABS].Put(syncer::FAVICON_IMAGES); pref_groups_[syncer::PROXY_TABS].Put(syncer::FAVICON_TRACKING); - pref_groups_[syncer::MANAGED_USER_SETTINGS].Put(syncer::SESSIONS); + pref_groups_[syncer::SUPERVISED_USER_SETTINGS].Put(syncer::SESSIONS); // TODO(zea): put favicons in the bookmarks group as well once it handles // those favicons. diff --git a/google_apis/gaia/gaia_constants.cc b/google_apis/gaia/gaia_constants.cc index 14a41c9..7dadc94 100644 --- a/google_apis/gaia/gaia_constants.cc +++ b/google_apis/gaia/gaia_constants.cc @@ -39,7 +39,7 @@ const char kAnyApiOAuth2Scope[] = "https://www.googleapis.com/auth/any-api"; const char kChromeSyncOAuth2Scope[] = "https://www.googleapis.com/auth/chromesync"; // OAuth2 scope for access to the Chrome Sync APIs for managed profiles. -const char kChromeSyncManagedOAuth2Scope[] = +const char kChromeSyncSupervisedOAuth2Scope[] = "https://www.googleapis.com/auth/chromesync_playpen"; // OAuth2 scope for access to Google Talk APIs (XMPP). const char kGoogleTalkOAuth2Scope[] = diff --git a/google_apis/gaia/gaia_constants.h b/google_apis/gaia/gaia_constants.h index 7adc130..4786ac8 100644 --- a/google_apis/gaia/gaia_constants.h +++ b/google_apis/gaia/gaia_constants.h @@ -25,7 +25,7 @@ extern const char kOAuthWrapBridgeUserInfoScope[]; extern const char kDeviceManagementServiceOAuth[]; extern const char kAnyApiOAuth2Scope[]; extern const char kChromeSyncOAuth2Scope[]; -extern const char kChromeSyncManagedOAuth2Scope[]; +extern const char kChromeSyncSupervisedOAuth2Scope[]; extern const char kGoogleTalkOAuth2Scope[]; extern const char kGoogleUserInfoEmail[]; extern const char kGoogleUserInfoProfile[]; diff --git a/sync/internal_api/public/base/model_type.h b/sync/internal_api/public/base/model_type.h index c70d72a..9132526 100644 --- a/sync/internal_api/public/base/model_type.h +++ b/sync/internal_api/public/base/model_type.h @@ -95,15 +95,15 @@ enum ModelType { // These preferences are synced before other user types and are never // encrypted. PRIORITY_PREFERENCES, - // Managed user settings. - MANAGED_USER_SETTINGS, - // Managed users. Every managed user is a profile that is configured remotely - // by this user and can have restrictions applied. MANAGED_USERS and - // MANAGED_USER_SETTINGS can not be encrypted. - MANAGED_USERS, - // Managed user shared settings. Shared settings can be modified both by the - // manager and the supervised user. - MANAGED_USER_SHARED_SETTINGS, + // Supervised user settings. + SUPERVISED_USER_SETTINGS, + // Supervised users. Every supervised user is a profile that is configured + // remotely by this user and can have restrictions applied. SUPERVISED_USERS + // and SUPERVISED_USER_SETTINGS can not be encrypted. + SUPERVISED_USERS, + // Supervised user shared settings. Shared settings can be modified both by + // the manager and the supervised user. + SUPERVISED_USER_SHARED_SETTINGS, // Distilled articles. ARTICLES, // App List items diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc index 0e2cb68..ed7b0b3 100644 --- a/sync/syncable/model_type.cc +++ b/sync/syncable/model_type.cc @@ -107,13 +107,13 @@ void AddDefaultFieldValue(ModelType datatype, case FAVICON_TRACKING: specifics->mutable_favicon_tracking(); break; - case MANAGED_USER_SETTINGS: + case SUPERVISED_USER_SETTINGS: specifics->mutable_managed_user_setting(); break; - case MANAGED_USERS: + case SUPERVISED_USERS: specifics->mutable_managed_user(); break; - case MANAGED_USER_SHARED_SETTINGS: + case SUPERVISED_USER_SHARED_SETTINGS: specifics->mutable_managed_user_shared_setting(); break; case ARTICLES: @@ -188,11 +188,11 @@ int GetSpecificsFieldNumberFromModelType(ModelType model_type) { return sync_pb::EntitySpecifics::kFaviconImageFieldNumber; case FAVICON_TRACKING: return sync_pb::EntitySpecifics::kFaviconTrackingFieldNumber; - case MANAGED_USER_SETTINGS: + case SUPERVISED_USER_SETTINGS: return sync_pb::EntitySpecifics::kManagedUserSettingFieldNumber; - case MANAGED_USERS: + case SUPERVISED_USERS: return sync_pb::EntitySpecifics::kManagedUserFieldNumber; - case MANAGED_USER_SHARED_SETTINGS: + case SUPERVISED_USER_SHARED_SETTINGS: return sync_pb::EntitySpecifics::kManagedUserSharedSettingFieldNumber; case ARTICLES: return sync_pb::EntitySpecifics::kArticleFieldNumber; @@ -313,13 +313,13 @@ ModelType GetModelTypeFromSpecifics(const sync_pb::EntitySpecifics& specifics) { return FAVICON_TRACKING; if (specifics.has_managed_user_setting()) - return MANAGED_USER_SETTINGS; + return SUPERVISED_USER_SETTINGS; if (specifics.has_managed_user()) - return MANAGED_USERS; + return SUPERVISED_USERS; if (specifics.has_managed_user_shared_setting()) - return MANAGED_USER_SHARED_SETTINGS; + return SUPERVISED_USER_SHARED_SETTINGS; if (specifics.has_article()) return ARTICLES; @@ -376,13 +376,13 @@ ModelTypeSet EncryptableUserTypes() { // Priority preferences are not encrypted because they might be synced before // encryption is ready. encryptable_user_types.Remove(PRIORITY_PREFERENCES); - // Managed user settings are not encrypted since they are set server-side. - encryptable_user_types.Remove(MANAGED_USER_SETTINGS); - // Managed users are not encrypted since they are managed server-side. - encryptable_user_types.Remove(MANAGED_USERS); - // Managed user shared settings are not encrypted since they are managed + // Supervised user settings are not encrypted since they are set server-side. + encryptable_user_types.Remove(SUPERVISED_USER_SETTINGS); + // Supervised users are not encrypted since they are managed server-side. + encryptable_user_types.Remove(SUPERVISED_USERS); + // Supervised user shared settings are not encrypted since they are managed // server-side and shared between manager and supervised user. - encryptable_user_types.Remove(MANAGED_USER_SHARED_SETTINGS); + encryptable_user_types.Remove(SUPERVISED_USER_SHARED_SETTINGS); // Proxy types have no sync representation and are therefore not encrypted. // Note however that proxy types map to one or more protocol types, which // may or may not be encrypted themselves. @@ -423,7 +423,7 @@ ModelTypeSet CoreTypes() { // The following are low priority core types. result.Put(SYNCED_NOTIFICATIONS); result.Put(SYNCED_NOTIFICATION_APP_INFO); - result.Put(MANAGED_USER_SHARED_SETTINGS); + result.Put(SUPERVISED_USER_SHARED_SETTINGS); return result; } @@ -433,7 +433,7 @@ ModelTypeSet PriorityCoreTypes() { result.PutAll(ControlTypes()); // The following are non-control core types. - result.Put(MANAGED_USERS); + result.Put(SUPERVISED_USERS); return result; } @@ -512,11 +512,11 @@ const char* ModelTypeToString(ModelType model_type) { return "Favicon Images"; case FAVICON_TRACKING: return "Favicon Tracking"; - case MANAGED_USER_SETTINGS: + case SUPERVISED_USER_SETTINGS: return "Managed User Settings"; - case MANAGED_USERS: + case SUPERVISED_USERS: return "Managed Users"; - case MANAGED_USER_SHARED_SETTINGS: + case SUPERVISED_USER_SHARED_SETTINGS: return "Managed User Shared Settings"; case ARTICLES: return "Articles"; @@ -587,15 +587,15 @@ int ModelTypeToHistogramInt(ModelType model_type) { return 24; case PROXY_TABS: return 25; - case MANAGED_USER_SETTINGS: + case SUPERVISED_USER_SETTINGS: return 26; - case MANAGED_USERS: + case SUPERVISED_USERS: return 27; case ARTICLES: return 28; case APP_LIST: return 29; - case MANAGED_USER_SHARED_SETTINGS: + case SUPERVISED_USER_SHARED_SETTINGS: return 30; case SYNCED_NOTIFICATION_APP_INFO: return 31; @@ -685,11 +685,11 @@ ModelType ModelTypeFromString(const std::string& model_type_string) { else if (model_type_string == "Favicon Tracking") return FAVICON_TRACKING; else if (model_type_string == "Managed User Settings") - return MANAGED_USER_SETTINGS; + return SUPERVISED_USER_SETTINGS; else if (model_type_string == "Managed Users") - return MANAGED_USERS; + return SUPERVISED_USERS; else if (model_type_string == "Managed User Shared Settings") - return MANAGED_USER_SHARED_SETTINGS; + return SUPERVISED_USER_SHARED_SETTINGS; else if (model_type_string == "Articles") return ARTICLES; else if (model_type_string == "Tabs") @@ -808,11 +808,11 @@ std::string ModelTypeToRootTag(ModelType type) { return "google_chrome_favicon_images"; case FAVICON_TRACKING: return "google_chrome_favicon_tracking"; - case MANAGED_USER_SETTINGS: + case SUPERVISED_USER_SETTINGS: return "google_chrome_managed_user_settings"; - case MANAGED_USERS: + case SUPERVISED_USERS: return "google_chrome_managed_users"; - case MANAGED_USER_SHARED_SETTINGS: + case SUPERVISED_USER_SHARED_SETTINGS: return "google_chrome_managed_user_shared_settings"; case ARTICLES: return "google_chrome_articles"; @@ -855,9 +855,9 @@ const char kPriorityPreferenceNotificationType[] = "PRIORITY_PREFERENCE"; const char kDictionaryNotificationType[] = "DICTIONARY"; const char kFaviconImageNotificationType[] = "FAVICON_IMAGE"; const char kFaviconTrackingNotificationType[] = "FAVICON_TRACKING"; -const char kManagedUserSettingNotificationType[] = "MANAGED_USER_SETTING"; -const char kManagedUserNotificationType[] = "MANAGED_USER"; -const char kManagedUserSharedSettingNotificationType[] = +const char kSupervisedUserSettingNotificationType[] = "MANAGED_USER_SETTING"; +const char kSupervisedUserNotificationType[] = "MANAGED_USER"; +const char kSupervisedUserSharedSettingNotificationType[] = "MANAGED_USER_SHARED_SETTING"; const char kArticleNotificationType[] = "ARTICLE"; } // namespace @@ -940,14 +940,14 @@ bool RealModelTypeToNotificationType(ModelType model_type, case FAVICON_TRACKING: *notification_type = kFaviconTrackingNotificationType; return true; - case MANAGED_USER_SETTINGS: - *notification_type = kManagedUserSettingNotificationType; + case SUPERVISED_USER_SETTINGS: + *notification_type = kSupervisedUserSettingNotificationType; return true; - case MANAGED_USERS: - *notification_type = kManagedUserNotificationType; + case SUPERVISED_USERS: + *notification_type = kSupervisedUserNotificationType; return true; - case MANAGED_USER_SHARED_SETTINGS: - *notification_type = kManagedUserSharedSettingNotificationType; + case SUPERVISED_USER_SHARED_SETTINGS: + *notification_type = kSupervisedUserSharedSettingNotificationType; return true; case ARTICLES: *notification_type = kArticleNotificationType; @@ -1036,14 +1036,15 @@ bool NotificationTypeToRealModelType(const std::string& notification_type, } else if (notification_type == kFaviconTrackingNotificationType) { *model_type = FAVICON_TRACKING; return true; - } else if (notification_type == kManagedUserSettingNotificationType) { - *model_type = MANAGED_USER_SETTINGS; + } else if (notification_type == kSupervisedUserSettingNotificationType) { + *model_type = SUPERVISED_USER_SETTINGS; return true; - } else if (notification_type == kManagedUserNotificationType) { - *model_type = MANAGED_USERS; + } else if (notification_type == kSupervisedUserNotificationType) { + *model_type = SUPERVISED_USERS; return true; - } else if (notification_type == kManagedUserSharedSettingNotificationType) { - *model_type = MANAGED_USER_SHARED_SETTINGS; + } else if (notification_type == + kSupervisedUserSharedSettingNotificationType) { + *model_type = SUPERVISED_USER_SHARED_SETTINGS; return true; } else if (notification_type == kArticleNotificationType) { *model_type = ARTICLES; diff --git a/sync/util/data_type_histogram.h b/sync/util/data_type_histogram.h index e2ab49f..b5e0eda 100644 --- a/sync/util/data_type_histogram.h +++ b/sync/util/data_type_histogram.h @@ -111,13 +111,13 @@ case ::syncer::FAVICON_TRACKING: \ PER_DATA_TYPE_MACRO("FaviconTracking"); \ break; \ - case ::syncer::MANAGED_USER_SETTINGS: \ + case ::syncer::SUPERVISED_USER_SETTINGS: \ PER_DATA_TYPE_MACRO("ManagedUserSetting"); \ break; \ - case ::syncer::MANAGED_USERS: \ + case ::syncer::SUPERVISED_USERS: \ PER_DATA_TYPE_MACRO("ManagedUser"); \ break; \ - case ::syncer::MANAGED_USER_SHARED_SETTINGS: \ + case ::syncer::SUPERVISED_USER_SHARED_SETTINGS: \ PER_DATA_TYPE_MACRO("ManagedUserSharedSetting"); \ break; \ case ::syncer::ARTICLES: \ |