Commit 43d33e91 authored by treib@chromium.org's avatar treib@chromium.org

Rename "managed (mode|user)" to "supervised user" (part 6)

Followup to https://codereview.chromium.org/350183002/

This CL renames (hopefully) all remaining C++/ObjC code apart from CrOS-specific code.
It also renames a test data folder.

Still missing:
- ChromeOS-specific code in c/b/chromeos/login/managed/ and ash/system/
- JavaScript, HTML, CSS
- The global ENABLE_MANAGED_USERS define

TBR=msw@chromium.org (c/b/ui)
TBR=atwilson@chromium.org (c/b/sync)
The TBRs are simple renames.

BUG=385113

Review URL: https://codereview.chromium.org/384023002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282962 0039d316-1c4b-4281-b951-d872f2087c98
parent df4f58a1
......@@ -400,10 +400,6 @@
'linux_seccomp_bpf': {
'filepath': 'content/common/sandbox.*linux.cc',
},
'managed_users': {
'filepath': 'chrome/browser/.*managed_mode'\
'|chrome/browser/.*managed_user',
},
'media': {
'filepath': 'media/|third_party/(ffmpeg|openmax)/|webmediaplayer|'\
'audio_message_filter|video_layer|media_internals',
......@@ -576,6 +572,11 @@
'streams': {
'filepath': 'content/browser/streams/',
},
'supervised_users': {
'filepath': 'chrome/browser/.*managed_mode'\
'|chrome/browser/.*managed_user'\
'|chrome/browser/.*supervised_user',
},
'sync': {
'filepath': 'chrome/browser/sync/|sync/|components/sync_driver/',
},
......@@ -856,7 +857,7 @@
'linux_fonts': ['derat+watch@chromium.org'],
'linux_sandboxing': ['agl@chromium.org', 'jln+watch@chromium.org'],
'linux_seccomp_bpf': ['jln+watch@chromium.org'],
'managed_users': ['pam+watch@chromium.org'],
'supervised_users': ['pam+watch@chromium.org'],
'media': ['feature-media-reviews@chromium.org'],
'media_galleries': ['gbillock@chromium.org', 'thestig@chromium.org',
'tommycli@chromium.org', 'vandebo@chromium.org'],
......
......@@ -378,7 +378,7 @@
<include name="IDR_USER_MANAGER_JS" file="resources\user_manager\user_manager.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_USER_MANAGER_HTML" file="resources\user_manager\user_manager.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
</if>
<include name="IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML" file="resources\managed_mode_block_interstitial.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML" file="resources\supervised_user_block_interstitial.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_PROFILE_SIGNIN_CONFIRMATION_HTML" file="resources\profile_signin_confirmation.html" type="BINDATA" />
<include name="IDR_PROFILE_SIGNIN_CONFIRMATION_JS" file="resources\profile_signin_confirmation.js" type="BINDATA" />
<include name="IDR_PROFILE_SIGNIN_CONFIRMATION_CSS" file="resources\profile_signin_confirmation.css" type="BINDATA" />
......
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
/* Copyright 2014 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
body {
......@@ -45,8 +45,10 @@ a {
* the resource manually. */
-webkit-user-select: none;
content: -webkit-image-set(
url('../../app/theme/default_100_percent/common/error_managed_mode_blocked_page.png') 1x,
url('../../app/theme/default_200_percent/common/error_managed_mode_blocked_page.png') 2x);
url('../../app/theme/default_100_percent/common/'
'error_managed_mode_blocked_page.png') 1x,
url('../../app/theme/default_200_percent/common/'
'error_managed_mode_blocked_page.png') 2x);
margin-bottom: 10px;
margin-top: 10px;
}
......
......@@ -4,11 +4,11 @@
<meta name="viewport" content="width=device-width">
<meta charset="utf-8">
<title i18n-content="blockPageTitle"></title>
<link rel="stylesheet" href="managed_mode_block_interstitial.css">
<link rel="stylesheet" href="supervised_user_block_interstitial.css">
<script src="../../../ui/webui/resources/js/cr.js"></script>
<script src="../../../ui/webui/resources/js/load_time_data.js"></script>
<script src="../../../ui/webui/resources/js/util.js"></script>
<script src="managed_mode_block_interstitial.js"></script>
<script src="supervised_user_block_interstitial.js"></script>
</head>
<body>
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......
......@@ -330,7 +330,7 @@ TEST_F(SupervisedUserServiceExtensionTest, InstallContentPacks) {
base::FilePath test_data_dir;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir));
base::FilePath extension_path =
test_data_dir.AppendASCII("extensions/managed_mode/content_pack");
test_data_dir.AppendASCII("extensions/supervised_user/content_pack");
content::WindowedNotificationObserver extension_load_observer(
chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::Source<Profile>(profile_.get()));
......@@ -361,7 +361,7 @@ TEST_F(SupervisedUserServiceExtensionTest, InstallContentPacks) {
// Load a second content pack.
installer = extensions::UnpackedInstaller::Create(service_);
extension_path =
test_data_dir.AppendASCII("extensions/managed_mode/content_pack_2");
test_data_dir.AppendASCII("extensions/supervised_user/content_pack_2");
installer->Load(extension_path);
observer.Wait();
......
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......
......@@ -93,7 +93,7 @@ void PopulateUsers(const ProfileInfoCache& profile_info,
users->clear();
const size_t count = profile_info.GetNumberOfProfiles();
for (size_t i = 0; i < count; ++i) {
// Don't display managed users.
// Don't display supervised users.
if (profile_info.ProfileIsSupervisedAtIndex(i))
continue;
......
......@@ -19,11 +19,12 @@ class Browser;
// will open the profile menu; in Incognito, clicking will do nothing.
@interface AvatarIconController : AvatarBaseController {
@private
// The managed user avatar label button. Only used for managed user profiles.
// The supervised user avatar label button. Only used for supervised user
// profiles.
base::scoped_nsobject<AvatarLabelButton> labelButton_;
}
// The managed user avatar label button view.
// The supervised user avatar label button view.
@property(readonly, nonatomic) NSButton* labelButtonView;
// Designated initializer.
......
......@@ -25,7 +25,7 @@ class Browser;
// Array of the below view controllers.
base::scoped_nsobject<NSMutableArray> items_;
// 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_;
}
......@@ -43,7 +43,7 @@ class Browser;
// Edits a given profile. |sender| is an AvatarMenuItemController.
- (IBAction)editProfile:(id)sender;
// Switches from the managed user avatar menu to the normal avatar menu which
// Switches from the supervised user avatar menu to the normal avatar menu which
// allows to switch profiles.
- (IBAction)switchProfile:(id)sender;
......
......@@ -244,9 +244,9 @@ TEST_F(ProfileMenuControllerTest, DeleteActiveProfile) {
base::ThreadRestrictions::SetIOAllowed(io_was_allowed);
}
TEST_F(ProfileMenuControllerTest, ManagedProfile) {
TEST_F(ProfileMenuControllerTest, SupervisedProfile) {
TestingProfileManager* manager = testing_profile_manager();
TestingProfile* managed_profile =
TestingProfile* supervised_profile =
manager->CreateTestingProfile("test1",
scoped_ptr<PrefServiceSyncable>(),
base::ASCIIToUTF16("Supervised User"),
......@@ -269,12 +269,12 @@ TEST_F(ProfileMenuControllerTest, ManagedProfile) {
ASSERT_EQ(@selector(newProfile:), [item action]);
EXPECT_TRUE([controller() validateMenuItem:item]);
// Open a new browser for the managed user and switch to it.
Browser::CreateParams managed_profile_params(
managed_profile, chrome::HOST_DESKTOP_TYPE_NATIVE);
scoped_ptr<Browser> managed_browser(
chrome::CreateBrowserWithTestWindowForParams(&managed_profile_params));
BrowserList::SetLastActive(managed_browser.get());
// Open a new browser for the supervised user and switch to it.
Browser::CreateParams supervised_profile_params(
supervised_profile, chrome::HOST_DESKTOP_TYPE_NATIVE);
scoped_ptr<Browser> supervised_browser(
chrome::CreateBrowserWithTestWindowForParams(&supervised_profile_params));
BrowserList::SetLastActive(supervised_browser.get());
item = [menu itemAtIndex:0];
ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]);
......
......@@ -72,7 +72,7 @@ class BrowserNonClientFrameView : public views::NonClientFrameView {
// icon. May be NULL for some frame styles.
AvatarMenuButton* avatar_button_;
// Avatar label that is used for a managed user.
// Avatar label that is used for a supervised user.
AvatarLabel* avatar_label_;
// Menu button that displays the name of the active or guest profile.
......
......@@ -29,8 +29,8 @@ class AvatarMenuButton : public views::MenuButton,
// Internal class name.
static const char kViewClassName[];
// Creates a new button. If |disabled| is true and we're not in managed mode,
// clicking on the button will cause the profile menu to be displayed.
// Creates a new button. Unless |disabled| is true, clicking on the button
// will cause the profile menu to be displayed.
AvatarMenuButton(Browser* browser, bool disabled);
virtual ~AvatarMenuButton();
......
......@@ -94,7 +94,7 @@ class CreateProfileHandler: public OptionsPageUIHandler {
// with the management server.
void RegisterSupervisedUser(bool create_shortcut,
chrome::HostDesktopType desktop_type,
const std::string& managed_user_id,
const std::string& supervised_user_id,
Profile* new_profile);
// Called back with the result of the supervised user registration.
......
......@@ -39,14 +39,14 @@
#include "chrome/browser/ui/webui/options/language_dictionary_overlay_handler.h"
#include "chrome/browser/ui/webui/options/language_options_handler.h"
#include "chrome/browser/ui/webui/options/manage_profile_handler.h"
#include "chrome/browser/ui/webui/options/managed_user_create_confirm_handler.h"
#include "chrome/browser/ui/webui/options/managed_user_import_handler.h"
#include "chrome/browser/ui/webui/options/managed_user_learn_more_handler.h"
#include "chrome/browser/ui/webui/options/media_devices_selection_handler.h"
#include "chrome/browser/ui/webui/options/password_manager_handler.h"
#include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h"
#include "chrome/browser/ui/webui/options/search_engine_manager_handler.h"
#include "chrome/browser/ui/webui/options/startup_pages_handler.h"
#include "chrome/browser/ui/webui/options/supervised_user_create_confirm_handler.h"
#include "chrome/browser/ui/webui/options/supervised_user_import_handler.h"
#include "chrome/browser/ui/webui/options/supervised_user_learn_more_handler.h"
#include "chrome/browser/ui/webui/sync_setup_handler.h"
#include "chrome/browser/ui/webui/theme_source.h"
#include "chrome/common/url_constants.h"
......@@ -284,15 +284,16 @@ OptionsUI::OptionsUI(content::WebUI* web_ui)
AddOptionsPageUIHandler(localized_strings,
new LanguageDictionaryOverlayHandler());
AddOptionsPageUIHandler(localized_strings, new ManageProfileHandler());
AddOptionsPageUIHandler(localized_strings,
new ManagedUserCreateConfirmHandler());
AddOptionsPageUIHandler(localized_strings, new ManagedUserImportHandler());
AddOptionsPageUIHandler(localized_strings, new ManagedUserLearnMoreHandler());
AddOptionsPageUIHandler(localized_strings, new PasswordManagerHandler());
AddOptionsPageUIHandler(localized_strings, new ResetProfileSettingsHandler());
AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler());
AddOptionsPageUIHandler(localized_strings, new ImportDataHandler());
AddOptionsPageUIHandler(localized_strings, new StartupPagesHandler());
AddOptionsPageUIHandler(localized_strings,
new SupervisedUserCreateConfirmHandler());
AddOptionsPageUIHandler(localized_strings, new SupervisedUserImportHandler());
AddOptionsPageUIHandler(localized_strings,
new SupervisedUserLearnMoreHandler());
AddOptionsPageUIHandler(localized_strings, new SyncSetupHandler(
g_browser_process->profile_manager()));
#if defined(OS_CHROMEOS)
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/options/managed_user_create_confirm_handler.h"
#include "chrome/browser/ui/webui/options/supervised_user_create_confirm_handler.h"
#include "base/bind.h"
#include "base/files/file_path.h"
......@@ -24,13 +24,13 @@
namespace options {
ManagedUserCreateConfirmHandler::ManagedUserCreateConfirmHandler() {
SupervisedUserCreateConfirmHandler::SupervisedUserCreateConfirmHandler() {
}
ManagedUserCreateConfirmHandler::~ManagedUserCreateConfirmHandler() {
SupervisedUserCreateConfirmHandler::~SupervisedUserCreateConfirmHandler() {
}
void ManagedUserCreateConfirmHandler::GetLocalizedValues(
void SupervisedUserCreateConfirmHandler::GetLocalizedValues(
base::DictionaryValue* localized_strings) {
DCHECK(localized_strings);
......@@ -53,13 +53,13 @@ void ManagedUserCreateConfirmHandler::GetLocalizedValues(
RegisterStrings(localized_strings, resources, arraysize(resources));
}
void ManagedUserCreateConfirmHandler::RegisterMessages() {
void SupervisedUserCreateConfirmHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("switchToProfile",
base::Bind(&ManagedUserCreateConfirmHandler::SwitchToProfile,
base::Bind(&SupervisedUserCreateConfirmHandler::SwitchToProfile,
base::Unretained(this)));
}
void ManagedUserCreateConfirmHandler::SwitchToProfile(
void SupervisedUserCreateConfirmHandler::SwitchToProfile(
const base::ListValue* args) {
DCHECK(args);
const base::Value* file_path_value;
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_CREATE_CONFIRM_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_CREATE_CONFIRM_HANDLER_H_
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_CREATE_CONFIRM_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_CREATE_CONFIRM_HANDLER_H_
#include "chrome/browser/ui/webui/options/options_ui.h"
......@@ -13,12 +13,12 @@ class DictionaryValue;
namespace options {
// Handler for the confirmation dialog after successful creation of a managed
// Handler for the confirmation dialog after successful creation of a supervised
// user.
class ManagedUserCreateConfirmHandler : public OptionsPageUIHandler {
class SupervisedUserCreateConfirmHandler : public OptionsPageUIHandler {
public:
ManagedUserCreateConfirmHandler();
virtual ~ManagedUserCreateConfirmHandler();
SupervisedUserCreateConfirmHandler();
virtual ~SupervisedUserCreateConfirmHandler();
// OptionsPageUIHandler implementation.
virtual void GetLocalizedValues(
......@@ -33,9 +33,9 @@ class ManagedUserCreateConfirmHandler : public OptionsPageUIHandler {
// |args| is of the form [ {string} profileFilePath ]
void SwitchToProfile(const base::ListValue* args);
DISALLOW_COPY_AND_ASSIGN(ManagedUserCreateConfirmHandler);
DISALLOW_COPY_AND_ASSIGN(SupervisedUserCreateConfirmHandler);
};
} // namespace options
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_CREATE_CONFIRM_HANDLER_H_
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_CREATE_CONFIRM_HANDLER_H_
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/options/managed_user_import_handler.h"
#include "chrome/browser/ui/webui/options/supervised_user_import_handler.h"
#include <set>
......@@ -47,11 +47,11 @@ scoped_ptr<base::ListValue> GetAvatarIcons() {
namespace options {
ManagedUserImportHandler::ManagedUserImportHandler()
SupervisedUserImportHandler::SupervisedUserImportHandler()
: observer_(this),
weak_ptr_factory_(this) {}
ManagedUserImportHandler::~ManagedUserImportHandler() {
SupervisedUserImportHandler::~SupervisedUserImportHandler() {
Profile* profile = Profile::FromWebUI(web_ui());
if (!profile->IsSupervised()) {
SupervisedUserSyncService* service =
......@@ -62,7 +62,7 @@ ManagedUserImportHandler::~ManagedUserImportHandler() {
}
}
void ManagedUserImportHandler::GetLocalizedValues(
void SupervisedUserImportHandler::GetLocalizedValues(
base::DictionaryValue* localized_strings) {
DCHECK(localized_strings);
......@@ -86,7 +86,7 @@ void ManagedUserImportHandler::GetLocalizedValues(
localized_strings->Set("avatarIcons", GetAvatarIcons().release());
}
void ManagedUserImportHandler::InitializeHandler() {
void SupervisedUserImportHandler::InitializeHandler() {
Profile* profile = Profile::FromWebUI(web_ui());
if (!profile->IsSupervised()) {
SupervisedUserSyncService* sync_service =
......@@ -99,7 +99,7 @@ void ManagedUserImportHandler::InitializeHandler() {
SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
profile);
subscription_ = settings_service->Subscribe(
base::Bind(&ManagedUserImportHandler::OnSharedSettingChanged,
base::Bind(&SupervisedUserImportHandler::OnSharedSettingChanged,
weak_ptr_factory_.GetWeakPtr()));
} else {
DCHECK(!SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
......@@ -109,41 +109,42 @@ void ManagedUserImportHandler::InitializeHandler() {
}
}
void ManagedUserImportHandler::RegisterMessages() {
void SupervisedUserImportHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("requestManagedUserImportUpdate",
base::Bind(&ManagedUserImportHandler::RequestManagedUserImportUpdate,
base::Bind(&SupervisedUserImportHandler::
RequestSupervisedUserImportUpdate,
base::Unretained(this)));
}
void ManagedUserImportHandler::OnSupervisedUsersChanged() {
FetchManagedUsers();
void SupervisedUserImportHandler::OnSupervisedUsersChanged() {
FetchSupervisedUsers();
}
void ManagedUserImportHandler::FetchManagedUsers() {
void SupervisedUserImportHandler::FetchSupervisedUsers() {
web_ui()->CallJavascriptFunction("options.ManagedUserListData.resetPromise");
RequestManagedUserImportUpdate(NULL);
RequestSupervisedUserImportUpdate(NULL);
}
void ManagedUserImportHandler::RequestManagedUserImportUpdate(
void SupervisedUserImportHandler::RequestSupervisedUserImportUpdate(
const base::ListValue* /* args */) {
if (Profile::FromWebUI(web_ui())->IsSupervised())
return;
if (!IsAccountConnected() || HasAuthError()) {
ClearManagedUsersAndShowError();
ClearSupervisedUsersAndShowError();
} else {
SupervisedUserSyncService* supervised_user_sync_service =
SupervisedUserSyncServiceFactory::GetForProfile(
Profile::FromWebUI(web_ui()));
if (supervised_user_sync_service) {
supervised_user_sync_service->GetSupervisedUsersAsync(
base::Bind(&ManagedUserImportHandler::SendExistingManagedUsers,
base::Bind(&SupervisedUserImportHandler::SendExistingSupervisedUsers,
weak_ptr_factory_.GetWeakPtr()));
}
}
}
void ManagedUserImportHandler::SendExistingManagedUsers(
void SupervisedUserImportHandler::SendExistingSupervisedUsers(
const base::DictionaryValue* dict) {
DCHECK(dict);
const ProfileInfoCache& cache =
......@@ -208,18 +209,18 @@ void ManagedUserImportHandler::SendExistingManagedUsers(
supervised_users);
}
void ManagedUserImportHandler::ClearManagedUsersAndShowError() {
void SupervisedUserImportHandler::ClearSupervisedUsersAndShowError() {
web_ui()->CallJavascriptFunction("options.ManagedUserListData.onSigninError");
}
bool ManagedUserImportHandler::IsAccountConnected() const {
bool SupervisedUserImportHandler::IsAccountConnected() const {
Profile* profile = Profile::FromWebUI(web_ui());
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);
return signin_manager && !signin_manager->GetAuthenticatedUsername().empty();
}
bool ManagedUserImportHandler::HasAuthError() const {
bool SupervisedUserImportHandler::HasAuthError() const {
Profile* profile = Profile::FromWebUI(web_ui());
ProfileOAuth2TokenService* token_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
......@@ -237,15 +238,15 @@ bool ManagedUserImportHandler::HasAuthError() const {
state == GoogleServiceAuthError::ACCOUNT_DISABLED;
}
void ManagedUserImportHandler::OnSharedSettingChanged(
void SupervisedUserImportHandler::OnSharedSettingChanged(
const std::string& supervised_user_id,
const std::string& key) {
if (key == supervised_users::kChromeAvatarIndex)
FetchManagedUsers();
FetchSupervisedUsers();
}
void ManagedUserImportHandler::OnErrorChanged() {
FetchManagedUsers();
void SupervisedUserImportHandler::OnErrorChanged() {
FetchSupervisedUsers();
}
} // namespace options
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_IMPORT_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_IMPORT_HANDLER_H_
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_
#include "base/callback_list.h"
#include "base/memory/weak_ptr.h"
......@@ -19,16 +19,16 @@ class ListValue;
namespace options {
// Handler for the 'import existing managed user' dialog.
class ManagedUserImportHandler : public OptionsPageUIHandler,
public SupervisedUserSyncServiceObserver,
public SigninErrorController::Observer {
// Handler for the 'import existing supervised user' dialog.
class SupervisedUserImportHandler : public OptionsPageUIHandler,
public SupervisedUserSyncServiceObserver,
public SigninErrorController::Observer {
public:
typedef base::CallbackList<void(const std::string&, const std::string&)>
CallbackList;
ManagedUserImportHandler();
virtual ~ManagedUserImportHandler();
SupervisedUserImportHandler();
virtual ~SupervisedUserImportHandler();
// OptionsPageUIHandler implementation.
virtual void GetLocalizedValues(
......@@ -48,49 +48,49 @@ class ManagedUserImportHandler : public OptionsPageUIHandler,
virtual void OnErrorChanged() OVERRIDE;
private:
// Clears the cached list of managed users and fetches the new list of managed
// users.
void FetchManagedUsers();
// Clears the cached list of supervised users and fetches the new list of
// supervised users.
void FetchSupervisedUsers();
// Callback for the "requestManagedUserImportUpdate" message.
// Checks the sign-in status of the custodian and accordingly
// sends an update to the WebUI. The update can be to show/hide
// an error bubble and update/clear the managed user list.
void RequestManagedUserImportUpdate(const base::ListValue* args);
// an error bubble and update/clear the supervised user list.
void RequestSupervisedUserImportUpdate(const base::ListValue* args);
// Sends an array of managed users to WebUI. Each entry is of the form:
// managedProfile = {
// id: "Managed User ID",
// name: "Managed User Name",
// Sends an array of supervised users to WebUI. Each entry is of the form:
// supervisedProfile = {
// id: "Supervised User ID",
// name: "Supervised User Name",
// iconURL: "chrome://path/to/icon/image",
// onCurrentDevice: true or false,
// needAvatar: true or false
// }
// The array holds all existing managed users attached to the
// The array holds all existing supervised users attached to the
// custodian's profile which initiated the request.
void SendExistingManagedUsers(const base::DictionaryValue* dict);
void SendExistingSupervisedUsers(const base::DictionaryValue* dict);
// Sends messages to the JS side to clear managed users and show an error
// Sends messages to the JS side to clear supervised users and show an error
// bubble.
void ClearManagedUsersAndShowError();
void ClearSupervisedUsersAndShowError();
bool IsAccountConnected() const;
bool HasAuthError() const;
// Called when a managed user shared setting is changed. If the avatar was
// changed, FetchManagedUsers() is called.
void OnSharedSettingChanged(const std::string& managed_user_id,
// Called when a supervised user shared setting is changed. If the avatar was
// changed, FetchSupervisedUsers() is called.
void OnSharedSettingChanged(const std::string& supervised_user_id,
const std::string& key);
scoped_ptr<CallbackList::Subscription> subscription_;
ScopedObserver<SigninErrorController, ManagedUserImportHandler> observer_;
ScopedObserver<SigninErrorController, SupervisedUserImportHandler> observer_;
base::WeakPtrFactory<ManagedUserImportHandler> weak_ptr_factory_;
base::WeakPtrFactory<SupervisedUserImportHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ManagedUserImportHandler);
DISALLOW_COPY_AND_ASSIGN(SupervisedUserImportHandler);
};
} // namespace options
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_IMPORT_HANDLER_H_
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_IMPORT_HANDLER_H_
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/options/managed_user_learn_more_handler.h"
#include "chrome/browser/ui/webui/options/supervised_user_learn_more_handler.h"
#include "base/values.h"
#include "grit/generated_resources.h"
namespace options {
ManagedUserLearnMoreHandler::ManagedUserLearnMoreHandler() {
SupervisedUserLearnMoreHandler::SupervisedUserLearnMoreHandler() {
}
ManagedUserLearnMoreHandler::~ManagedUserLearnMoreHandler() {
SupervisedUserLearnMoreHandler::~SupervisedUserLearnMoreHandler() {
}
void ManagedUserLearnMoreHandler::GetLocalizedValues(
void SupervisedUserLearnMoreHandler::GetLocalizedValues(
base::DictionaryValue* localized_strings) {
DCHECK(localized_strings);
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_LEARN_MORE_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_LEARN_MORE_HANDLER_H_
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_LEARN_MORE_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_LEARN_MORE_HANDLER_H_
#include "chrome/browser/ui/webui/options/options_ui.h"
......@@ -13,21 +13,21 @@ class DictionaryValue;
namespace options {
// Handler for the "Learn more" dialog available during creation of a managed
// Handler for the "Learn more" dialog available during creation of a supervised
// user.
class ManagedUserLearnMoreHandler : public OptionsPageUIHandler {
class SupervisedUserLearnMoreHandler : public OptionsPageUIHandler {
public:
ManagedUserLearnMoreHandler();
virtual ~ManagedUserLearnMoreHandler();
SupervisedUserLearnMoreHandler();
virtual ~SupervisedUserLearnMoreHandler();
// OptionsPageUIHandler implementation.
virtual void GetLocalizedValues(
base::DictionaryValue* localized_strings) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(ManagedUserLearnMoreHandler);
DISALLOW_COPY_AND_ASSIGN(SupervisedUserLearnMoreHandler);
};
} // namespace options
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_LEARN_MORE_HANDLER_H_
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SUPERVISED_USER_LEARN_MORE_HANDLER_H_
......@@ -1723,12 +1723,6 @@
'browser/ui/webui/options/language_options_handler_common.h',
'browser/ui/webui/options/manage_profile_handler.cc',
'browser/ui/webui/options/manage_profile_handler.h',
'browser/ui/webui/options/managed_user_create_confirm_handler.cc',
'browser/ui/webui/options/managed_user_create_confirm_handler.h',
'browser/ui/webui/options/managed_user_import_handler.cc',
'browser/ui/webui/options/managed_user_import_handler.h',
'browser/ui/webui/options/managed_user_learn_more_handler.cc',
'browser/ui/webui/options/managed_user_learn_more_handler.h',
'browser/ui/webui/options/media_devices_selection_handler.cc',
'browser/ui/webui/options/media_devices_selection_handler.h',
'browser/ui/webui/options/options_handlers_helper.cc',
......@@ -1745,6 +1739,12 @@
'browser/ui/webui/options/search_engine_manager_handler.h',
'browser/ui/webui/options/startup_pages_handler.cc',
'browser/ui/webui/options/startup_pages_handler.h',
'browser/ui/webui/options/supervised_user_create_confirm_handler.cc',
'browser/ui/webui/options/supervised_user_create_confirm_handler.h',
'browser/ui/webui/options/supervised_user_import_handler.cc',
'browser/ui/webui/options/supervised_user_import_handler.h',
'browser/ui/webui/options/supervised_user_learn_more_handler.cc',
'browser/ui/webui/options/supervised_user_learn_more_handler.h',
'browser/ui/webui/performance_monitor/performance_monitor_handler.cc',
'browser/ui/webui/performance_monitor/performance_monitor_handler.h',
'browser/ui/webui/performance_monitor/performance_monitor_l10n.cc',
......
......@@ -2418,11 +2418,11 @@
'browser/sync/test/integration/single_client_bookmarks_sync_test.cc',
'browser/sync/test/integration/single_client_dictionary_sync_test.cc',
'browser/sync/test/integration/single_client_extensions_sync_test.cc',
'browser/sync/test/integration/single_client_managed_user_settings_sync_test.cc',
'browser/sync/test/integration/single_client_passwords_sync_test.cc',
'browser/sync/test/integration/single_client_preferences_sync_test.cc',
'browser/sync/test/integration/single_client_search_engines_sync_test.cc',
'browser/sync/test/integration/single_client_sessions_sync_test.cc',
'browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc',
'browser/sync/test/integration/single_client_themes_sync_test.cc',
'browser/sync/test/integration/single_client_typed_urls_sync_test.cc',
'browser/sync/test/integration/sync_auth_test.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment