Commit fae057a6 authored by pam@chromium.org's avatar pam@chromium.org

Update strings to match the final spec.

Update strings, images, and UI to match final versions approved by UX, and
include the custodian's name where applicable. Remove references to
"limited users" in the code -- we don't need even more name fragmentation.

The custodian's name is not yet collected, but we fall back to the email
address if we don't have it.

TBR=sail@chromium.org
TBR=kalman@chromium.org

BUG=248859, 252212
TEST=manual

Review URL: https://chromiumcodereview.appspot.com/17320005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207943 0039d316-1c4b-4281-b951-d872f2087c98
parent 83ed59be
This diff is collapsed.
...@@ -772,7 +772,7 @@ const Experiment kExperiments[] = { ...@@ -772,7 +772,7 @@ const Experiment kExperiments[] = {
"enable-managed-users", "enable-managed-users",
IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME, IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION, IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
kOsMac | kOsWin | kOsLinux | kOsAndroid | kOsCrOSOwnerOnly, kOsMac | kOsWin | kOsLinux | kOsCrOSOwnerOnly,
SINGLE_VALUE_TYPE(switches::kEnableManagedUsers) SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
}, },
#if defined(USE_ASH) #if defined(USE_ASH)
......
...@@ -1107,7 +1107,7 @@ bool DeveloperPrivateGetStringsFunction::RunImpl() { ...@@ -1107,7 +1107,7 @@ bool DeveloperPrivateGetStringsFunction::RunImpl() {
SET_STRING("extensionSettingsPolicyControlled", SET_STRING("extensionSettingsPolicyControlled",
IDS_EXTENSIONS_POLICY_CONTROLLED); IDS_EXTENSIONS_POLICY_CONTROLLED);
SET_STRING("extensionSettingsManagedMode", SET_STRING("extensionSettingsManagedMode",
IDS_EXTENSIONS_LOCKED_MANAGED_MODE); IDS_EXTENSIONS_LOCKED_MANAGED_USER);
SET_STRING("extensionSettingsShowButton", IDS_EXTENSIONS_SHOW_BUTTON); SET_STRING("extensionSettingsShowButton", IDS_EXTENSIONS_SHOW_BUTTON);
SET_STRING("appsDevtoolLoadUnpackedButton", SET_STRING("appsDevtoolLoadUnpackedButton",
IDS_APPS_DEVTOOL_LOAD_UNPACKED_BUTTON); IDS_APPS_DEVTOOL_LOAD_UNPACKED_BUTTON);
......
...@@ -52,19 +52,25 @@ std::string ManagedModeInterstitial::GetHTMLContents() { ...@@ -52,19 +52,25 @@ std::string ManagedModeInterstitial::GetHTMLContents() {
DictionaryValue strings; DictionaryValue strings;
strings.SetString("blockPageTitle", strings.SetString("blockPageTitle",
l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_TITLE)); l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_TITLE));
strings.SetString("blockPageMessage",
l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_MESSAGE)); Profile* profile =
Profile::FromBrowserContext(web_contents_->GetBrowserContext());
ManagedUserService* managed_user_service =
ManagedUserServiceFactory::GetForProfile(profile);
string16 custodian = UTF8ToUTF16(managed_user_service->GetCustodianName());
strings.SetString(
"blockPageMessage",
l10n_util::GetStringFUTF16(IDS_BLOCK_INTERSTITIAL_MESSAGE, custodian));
strings.SetString("backButton", l10n_util::GetStringUTF16(IDS_BACK_BUTTON)); strings.SetString("backButton", l10n_util::GetStringUTF16(IDS_BACK_BUTTON));
strings.SetString( strings.SetString(
"requestAccessButton", "requestAccessButton",
l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_ACCESS_BUTTON)); l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_ACCESS_BUTTON));
// TODO(sergiu): Set name to real value here.
std::string custodian_name("John Doe");
strings.SetString( strings.SetString(
"requestSentMessage", "requestSentMessage",
l10n_util::GetStringFUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE, l10n_util::GetStringFUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE,
ASCIIToUTF16(custodian_name))); custodian));
webui::SetFontAndTextDirection(&strings); webui::SetFontAndTextDirection(&strings);
......
...@@ -125,7 +125,7 @@ void ManagedModeWarningInfobarDelegate::InfoBarDismissed() { ...@@ -125,7 +125,7 @@ void ManagedModeWarningInfobarDelegate::InfoBarDismissed() {
} }
string16 ManagedModeWarningInfobarDelegate::GetMessageText() const { string16 ManagedModeWarningInfobarDelegate::GetMessageText() const {
return l10n_util::GetStringUTF16(IDS_MANAGED_MODE_WARNING_MESSAGE); return l10n_util::GetStringUTF16(IDS_MANAGED_USER_WARN_INFOBAR_MESSAGE);
} }
int ManagedModeWarningInfobarDelegate::GetButtons() const { int ManagedModeWarningInfobarDelegate::GetButtons() const {
...@@ -135,7 +135,7 @@ int ManagedModeWarningInfobarDelegate::GetButtons() const { ...@@ -135,7 +135,7 @@ int ManagedModeWarningInfobarDelegate::GetButtons() const {
string16 ManagedModeWarningInfobarDelegate::GetButtonLabel( string16 ManagedModeWarningInfobarDelegate::GetButtonLabel(
InfoBarButton button) const { InfoBarButton button) const {
DCHECK_EQ(BUTTON_OK, button); DCHECK_EQ(BUTTON_OK, button);
return l10n_util::GetStringUTF16(IDS_MANAGED_MODE_GO_BACK_ACTION); return l10n_util::GetStringUTF16(IDS_MANAGED_USER_WARN_INFOBAR_GO_BACK);
} }
bool ManagedModeWarningInfobarDelegate::Accept() { bool ManagedModeWarningInfobarDelegate::Accept() {
......
...@@ -176,7 +176,10 @@ void ManagedUserService::RegisterUserPrefs( ...@@ -176,7 +176,10 @@ void ManagedUserService::RegisterUserPrefs(
prefs::kDefaultManagedModeFilteringBehavior, ManagedModeURLFilter::ALLOW, prefs::kDefaultManagedModeFilteringBehavior, ManagedModeURLFilter::ALLOW,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterStringPref( registry->RegisterStringPref(
prefs::kManagedUserCustodian, std::string(), prefs::kManagedUserCustodianEmail, std::string(),
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterStringPref(
prefs::kManagedUserCustodianName, std::string(),
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
} }
...@@ -218,7 +221,13 @@ void ManagedUserService::GetCategoryNames(CategoryList* list) { ...@@ -218,7 +221,13 @@ void ManagedUserService::GetCategoryNames(CategoryList* list) {
} }
std::string ManagedUserService::GetCustodianEmailAddress() const { std::string ManagedUserService::GetCustodianEmailAddress() const {
return profile_->GetPrefs()->GetString(prefs::kManagedUserCustodian); return profile_->GetPrefs()->GetString(prefs::kManagedUserCustodianEmail);
}
std::string ManagedUserService::GetCustodianName() const {
std::string name = profile_->GetPrefs()->GetString(
prefs::kManagedUserCustodianName);
return name.empty() ? GetCustodianEmailAddress() : name;
} }
std::string ManagedUserService::GetDebugPolicyProviderName() const { std::string ManagedUserService::GetDebugPolicyProviderName() const {
...@@ -347,7 +356,7 @@ bool ManagedUserService::ExtensionManagementPolicyImpl( ...@@ -347,7 +356,7 @@ bool ManagedUserService::ExtensionManagementPolicyImpl(
return true; return true;
if (error) if (error)
*error = l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_MANAGED_MODE); *error = l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_MANAGED_USER);
return false; return false;
} }
...@@ -562,7 +571,7 @@ void ManagedUserService::OnManagedUserRegistered( ...@@ -562,7 +571,7 @@ void ManagedUserService::OnManagedUserRegistered(
InitSync(token); InitSync(token);
SigninManagerBase* signin = SigninManagerBase* signin =
SigninManagerFactory::GetForProfile(custodian_profile); SigninManagerFactory::GetForProfile(custodian_profile);
profile_->GetPrefs()->SetString(prefs::kManagedUserCustodian, profile_->GetPrefs()->SetString(prefs::kManagedUserCustodianEmail,
signin->GetAuthenticatedUsername()); signin->GetAuthenticatedUsername());
callback.Run(profile_, Profile::CREATE_STATUS_INITIALIZED); callback.Run(profile_, Profile::CREATE_STATUS_INITIALIZED);
} }
......
...@@ -93,6 +93,10 @@ class ManagedUserService : public BrowserContextKeyedService, ...@@ -93,6 +93,10 @@ class ManagedUserService : public BrowserContextKeyedService,
// Returns the email address of the custodian. // Returns the email address of the custodian.
std::string GetCustodianEmailAddress() const; std::string GetCustodianEmailAddress() const;
// Returns the name of the custodian, or the email address if the name is
// empty.
std::string GetCustodianName() const;
// These methods allow querying and modifying the manual filtering behavior. // These methods allow querying and modifying the manual filtering behavior.
// The manual behavior is set by the user and overrides all other settings // The manual behavior is set by the user and overrides all other settings
// (whitelists or the default behavior). // (whitelists or the default behavior).
......
...@@ -238,7 +238,7 @@ base::string16 AvatarMenuModel::GetManagedUserInformation() const { ...@@ -238,7 +238,7 @@ base::string16 AvatarMenuModel::GetManagedUserInformation() const {
ManagedUserService* service = ManagedUserServiceFactory::GetForProfile( ManagedUserService* service = ManagedUserServiceFactory::GetForProfile(
browser_->profile()); browser_->profile());
if (service->ProfileIsManaged()) { if (service->ProfileIsManaged()) {
base::string16 custodian = UTF8ToUTF16(service->GetCustodianEmailAddress()); base::string16 custodian = UTF8ToUTF16(service->GetCustodianName());
return l10n_util::GetStringFUTF16(IDS_MANAGED_USER_INFO, custodian); return l10n_util::GetStringFUTF16(IDS_MANAGED_USER_INFO, custodian);
} }
#endif #endif
......
...@@ -1076,7 +1076,7 @@ cr.define('options', function() { ...@@ -1076,7 +1076,7 @@ cr.define('options', function() {
}, },
/** /**
* Reports a remote error (e.g., a network error during limited-user * Reports a remote error (e.g., a network error during managed-user
* registration) to the "create" overlay during profile creation. * registration) to the "create" overlay during profile creation.
* @private * @private
*/ */
......
...@@ -102,20 +102,25 @@ ...@@ -102,20 +102,25 @@
-webkit-margin-end: 10px; -webkit-margin-end: 10px;
} }
#delete-profile-message { #delete-profile-message,
#delete-managed-profile-addendum {
-webkit-padding-start: 48px; -webkit-padding-start: 48px;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
#delete-managed-profile-addendum {
margin-top: 10px;
}
html[dir='rtl'] #delete-profile-message { html[dir='rtl'] #delete-profile-message {
background-position: right; background-position: right;
} }
#create-profile-limited-not-signed-in { #create-profile-managed-not-signed-in {
color: #999; color: #999;
} }
#create-profile-limited-not-signed-in-label { #create-profile-managed-not-signed-in-label {
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
} }
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<h1 i18n-content="deleteProfileTitle"></h1> <h1 i18n-content="deleteProfileTitle"></h1>
<div class="content-area"> <div class="content-area">
<div id="delete-profile-message"></div> <div id="delete-profile-message"></div>
<div id="delete-managed-profile-addendum"
i18n-values=".innerHTML:deleteManagedProfileAddendum" hidden>
</div>
</div> </div>
<div class="action-area button-strip"> <div class="action-area button-strip">
<button id="delete-profile-cancel" i18n-content="cancel"></button> <button id="delete-profile-cancel" i18n-content="cancel"></button>
...@@ -71,22 +74,22 @@ ...@@ -71,22 +74,22 @@
</span> </span>
</label> </label>
</div> </div>
<div id="create-profile-limited-container" class="checkbox" hidden> <div id="create-profile-managed-container" class="checkbox" hidden>
<label> <label>
<input id="create-profile-limited" type="checkbox"> <input id="create-profile-managed" type="checkbox">
<span id="create-profile-limited-signed-in"> <span id="create-profile-managed-signed-in">
<span id="create-profile-limited-signed-in-label"></span> <span id="create-profile-managed-signed-in-label"></span>
<button id="create-profile-limited-signed-in-link" <button id="create-profile-managed-signed-in-link"
class="link-button" i18n-content="learnMore"> class="link-button" i18n-content="learnMore">
</button> </button>
</span> </span>
<span id="create-profile-limited-not-signed-in" hidden> <span id="create-profile-managed-not-signed-in" hidden>
<span id="create-profile-limited-not-signed-in-label" <span id="create-profile-managed-not-signed-in-label"
i18n-content="manageProfilesLimitedNotSignedInLabel"> i18n-content="manageProfilesManagedNotSignedInLabel">
</span> </span>
<button id="create-profile-limited-not-signed-in-link" <button id="create-profile-managed-not-signed-in-link"
class="link-button" class="link-button"
i18n-content="manageProfilesLimitedNotSignedInLink"> i18n-content="manageProfilesManagedNotSignedInLink">
</button> </button>
</span> </span>
</label> </label>
......
...@@ -59,7 +59,7 @@ cr.define('options', function() { ...@@ -59,7 +59,7 @@ cr.define('options', function() {
}; };
if (loadTimeData.getBoolean('managedUsersEnabled')) { if (loadTimeData.getBoolean('managedUsersEnabled')) {
$('create-profile-limited-container').hidden = false; $('create-profile-managed-container').hidden = false;
} }
$('manage-profile-cancel').onclick = $('manage-profile-cancel').onclick =
$('delete-profile-cancel').onclick = function(event) { $('delete-profile-cancel').onclick = function(event) {
...@@ -76,12 +76,12 @@ cr.define('options', function() { ...@@ -76,12 +76,12 @@ cr.define('options', function() {
chrome.send('removeProfileShortcut', [self.profileInfo_.filePath]); chrome.send('removeProfileShortcut', [self.profileInfo_.filePath]);
}; };
$('create-profile-limited-signed-in-link').onclick = function(event) { $('create-profile-managed-signed-in-link').onclick = function(event) {
OptionsPage.navigateToPage('managedUserLearnMore'); OptionsPage.navigateToPage('managedUserLearnMore');
return false; return false;
}; };
$('create-profile-limited-not-signed-in-link').onclick = function(event) { $('create-profile-managed-not-signed-in-link').onclick = function(event) {
// The signin process will open an overlay to configure sync, which // The signin process will open an overlay to configure sync, which
// would replace this overlay. It's smoother to close this one now. // would replace this overlay. It's smoother to close this one now.
// TODO(pamg): Move the sync-setup overlay to a higher layer so this one // TODO(pamg): Move the sync-setup overlay to a higher layer so this one
...@@ -143,8 +143,9 @@ cr.define('options', function() { ...@@ -143,8 +143,9 @@ cr.define('options', function() {
* profileInfo = { * profileInfo = {
* name: "Profile Name", * name: "Profile Name",
* iconURL: "chrome://path/to/icon/image", * iconURL: "chrome://path/to/icon/image",
* filePath: "/path/to/profile/data/on/disk" * filePath: "/path/to/profile/data/on/disk",
* isCurrentProfile: false, * isCurrentProfile: false,
* isManaged: false
* }; * };
* @param {string} mode A label that specifies the type of dialog * @param {string} mode A label that specifies the type of dialog
* box which is currently being viewed (i.e. 'create' or * box which is currently being viewed (i.e. 'create' or
...@@ -308,7 +309,7 @@ cr.define('options', function() { ...@@ -308,7 +309,7 @@ cr.define('options', function() {
var name = $('create-profile-name').value; var name = $('create-profile-name').value;
var iconUrl = $('create-profile-icon-grid').selectedItem; var iconUrl = $('create-profile-icon-grid').selectedItem;
var createShortcut = $('create-shortcut').checked; var createShortcut = $('create-shortcut').checked;
var isManaged = $('create-profile-limited').checked; var isManaged = $('create-profile-managed').checked;
// 'createProfile' is handled by the BrowserOptionsHandler. // 'createProfile' is handled by the BrowserOptionsHandler.
chrome.send('createProfile', chrome.send('createProfile',
...@@ -370,6 +371,7 @@ cr.define('options', function() { ...@@ -370,6 +371,7 @@ cr.define('options', function() {
loadTimeData.getStringF('deleteProfileMessage', profileInfo.name); loadTimeData.getStringF('deleteProfileMessage', profileInfo.name);
$('delete-profile-message').style.backgroundImage = 'url("' + $('delete-profile-message').style.backgroundImage = 'url("' +
profileInfo.iconURL + '")'; profileInfo.iconURL + '")';
$('delete-managed-profile-addendum').hidden = !profileInfo.isManaged;
// Because this dialog isn't useful when refreshing or as part of the // Because this dialog isn't useful when refreshing or as part of the
// history, don't create a history entry for it when showing. // history, don't create a history entry for it when showing.
...@@ -470,7 +472,7 @@ cr.define('options', function() { ...@@ -470,7 +472,7 @@ cr.define('options', function() {
$('create-profile-icon-grid').disabled = inProgress; $('create-profile-icon-grid').disabled = inProgress;
$('create-profile-name').disabled = inProgress; $('create-profile-name').disabled = inProgress;
$('create-shortcut').disabled = inProgress; $('create-shortcut').disabled = inProgress;
$('create-profile-limited').disabled = inProgress; $('create-profile-managed').disabled = inProgress;
$('create-profile-ok').disabled = inProgress; $('create-profile-ok').disabled = inProgress;
$('create-profile-throbber').hidden = !inProgress; $('create-profile-throbber').hidden = !inProgress;
...@@ -511,7 +513,7 @@ cr.define('options', function() { ...@@ -511,7 +513,7 @@ cr.define('options', function() {
}, },
/** /**
* For new limited users, shows a confirmation page after successfully * For new supervised users, shows a confirmation page after successfully
* creating a new profile; otherwise, the handler will open a new window. * creating a new profile; otherwise, the handler will open a new window.
* @param {Object} profileInfo An object of the form: * @param {Object} profileInfo An object of the form:
* profileInfo = { * profileInfo = {
...@@ -539,13 +541,13 @@ cr.define('options', function() { ...@@ -539,13 +541,13 @@ cr.define('options', function() {
*/ */
updateSignedInStatus_: function(text) { updateSignedInStatus_: function(text) {
var isSignedIn = text !== ''; var isSignedIn = text !== '';
$('create-profile-limited-signed-in').hidden = !isSignedIn; $('create-profile-managed-signed-in').hidden = !isSignedIn;
$('create-profile-limited-not-signed-in').hidden = isSignedIn; $('create-profile-managed-not-signed-in').hidden = isSignedIn;
$('create-profile-limited').disabled = !isSignedIn; $('create-profile-managed').disabled = !isSignedIn;
if (!isSignedIn) if (!isSignedIn)
$('create-profile-limited').checked = false; $('create-profile-managed').checked = false;
$('create-profile-limited-signed-in-label').textContent = text; $('create-profile-managed-signed-in-label').textContent = text;
}, },
}; };
......
...@@ -6,107 +6,13 @@ ...@@ -6,107 +6,13 @@
width: 612px; width: 612px;
} }
/* Carousel slides. The way the carousel works is by looking at the currently #managed-user-created-image {
* selected radio box, which tells us which slide is visible now. */ background-image: url('managed_user_create_confirm.png');
height: 177px; /* Placeholder value */
}
.managed-user-created-slide-text { #managed-user-created-text {
margin-top: 10px; margin-top: 10px;
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
} }
.managed-user-created-slide-image {
height: 177px; /* Placeholder value */
}
.managed-user-created-slide:nth-child(1) .managed-user-created-slide-image {
background-image: url('managed_user_create_confirm_1.png');
}
.managed-user-created-slide:nth-child(2) .managed-user-created-slide-image {
background-image: url('managed_user_create_confirm_2.png');
}
.managed-user-created-slide:nth-child(3) .managed-user-created-slide-image {
background-image: url('managed_user_create_confirm_3.png');
}
/* Need to be adjusted to the number of slides. */
#managed-user-created-slide-deck {
/* Number of slides multiplied by 100%. */
width: 300%;
}
#managed-user-created-slide-deck .managed-user-created-slide {
float: left;
/* 100% divided by number of slides. */
width: 33.334%;
}
#managed-user-created-viewport {
overflow: hidden;
width: 100%;
}
html[dir='rtl'] #managed-user-created-slide-deck .managed-user-created-slide {
float: right;
}
.content-area #managed-user-created-slide-deck {
-webkit-transition: all 750ms cubic-bezier(0.75, 0.00, 0.25, 1.00);
}
/* The small circular buttons/indicators. They are labels for the radio boxes
* that control the slides, so clicking them will actually check the proper
* radio box for that slide and change the slide. */
#managed-user-created-small-buttons {
-webkit-box-flex: 1;
-webkit-margin-start: 274px;
}
#managed-user-created-small-buttons button {
background: rgb(186, 186, 186);
border-radius: 4px;
border-width: 0;
display: inline-block;
min-height: 8px;
min-width: 8px;
padding: 0;
}
#managed-user-created-small-buttons
.managed-user-created-small-button-selected {
background: rgb(67, 67, 67);
}
/* Next and previous arrows. */
#managed-user-created-slide-arrows {
height: 30px;
position: absolute;
/* Needs to be adjusted according to the slide image size. */
top: 122px;
width: 100%;
}
#managed-user-created-slide-arrows button {
border-radius: 15px;
border-width: 0;
box-shadow: none;
height: 30px;
min-height: 30px;
min-width: 30px;
width: 30px;
}
#managed-user-created-left-slide-arrow {
-webkit-transform: scaleX(-1);
background: url('arrow_next.png') no-repeat center, white;
float: left;
}
#managed-user-created-right-slide-arrow {
background: url('arrow_next.png') no-repeat center, white;
float: right;
}
<div id="managed-user-created" class="page" hidden> <div id="managed-user-created" class="page" hidden>
<div class="close-button"></div> <div class="close-button"></div>
<!-- Overlay for the confirmation after creating a limited user. --> <!-- Overlay for the confirmation after creating a supervised user. -->
<h1 id="managed-user-created-title"></h1> <h1 id="managed-user-created-title"></h1>
<div class="content-area"> <div class="content-area">
<div id="managed-user-created-viewport"> <div id="managed-user-created-image"></div>
<div id="managed-user-created-slide-deck"> <div id="managed-user-created-text"></div>
<div class="managed-user-created-slide">
<div class="managed-user-created-slide-image"></div>
<div class="managed-user-created-slide-text"
i18n-values=".innerHTML:managedUserCreateConfirmTextSlide1">
</div>
</div>
<div class="managed-user-created-slide">
<div class="managed-user-created-slide-image"></div>
<div class="managed-user-created-slide-text"
i18n-values=".innerHTML:managedUserCreateConfirmTextSlide2">
</div>
</div>
<div class="managed-user-created-slide">
<div class="managed-user-created-slide-image"></div>
<div class="managed-user-created-slide-text"
i18n-values=".innerHTML:managedUserCreateConfirmTextSlide3">
</div>
</div>
</div>
</div>
</div>
<div id="managed-user-created-slide-arrows">
<button id="managed-user-created-left-slide-arrow"></button>
<button id="managed-user-created-right-slide-arrow"></button>
</div> </div>
<div class="action-area button-strip"> <div class="action-area button-strip">
<div id="managed-user-created-small-buttons">
</div>
<button id="managed-user-created-done" <button id="managed-user-created-done"
i18n-content="managedUserCreateConfirmDone"> i18n-content="managedUserCreatedDone">
</button> </button>
<button id="managed-user-created-switch"></button> <button id="managed-user-created-switch"></button>
</div> </div>
......
...@@ -27,9 +27,6 @@ cr.define('options', function() { ...@@ -27,9 +27,6 @@ cr.define('options', function() {
// Info about the newly created profile. // Info about the newly created profile.
profileInfo_: null, profileInfo_: null,
// Current shown slide.
currentSlide_: 0,
/** /**
* Initialize the page. * Initialize the page.
*/ */
...@@ -46,80 +43,6 @@ cr.define('options', function() { ...@@ -46,80 +43,6 @@ cr.define('options', function() {
OptionsPage.closeOverlay(); OptionsPage.closeOverlay();
chrome.send('switchToProfile', [self.profileInfo_.filePath]); chrome.send('switchToProfile', [self.profileInfo_.filePath]);
}; };
// Create a small dot button for each slide in the deck and make the
// first button active.
var numberOfSlides = $('managed-user-created-slide-deck').children.length;
for (var i = 0; i < numberOfSlides; i++) {
var smallButton = document.createElement('button');
$('managed-user-created-small-buttons').appendChild(smallButton);
smallButton.onclick = this.setCurrentSlide_.bind(this, i);
}
$('managed-user-created-small-buttons').children[0].classList.add(
'managed-user-created-small-button-selected');
// Changes the slide in |direction|, where |direction| can be 'Left' or
// 'Right'. Changing to the left goes back in LTR and forward in RTL and
// vice versa for right.
function changeSlide(direction) {
// Ignore all events we get while not visible.
if (!self.visible)
return;
// Ignore anything other than left and right arrow press.
if (direction != 'Left' && direction != 'Right')
return;
var container = $('managed-user-created');
var rtl = getComputedStyle(container).direction == 'rtl';
if ((direction == 'Right' && !rtl) || (direction == 'Left' && rtl))
self.setCurrentSlide_(self.currentSlide_ + 1);
else
self.setCurrentSlide_(self.currentSlide_ - 1);
};
$('managed-user-created-left-slide-arrow').onclick =
changeSlide.bind(undefined, 'Left');
$('managed-user-created-right-slide-arrow').onclick =
changeSlide.bind(undefined, 'Right');
document.onkeydown = function(event) {
changeSlide(event.keyIdentifier);
};
},
/**
* Reset to slide 1 for the next time this gets opened.
* @override
*/
didShowPage: function() {
this.setCurrentSlide_(0);
},
/**
* Sets the current visible slide to |slide|, where |slide| is the index
* and starts from 0.
* @param {number} slide The slide to set.
* @private
*/
setCurrentSlide_: function(slide) {
var numberOfSlides =
$('managed-user-created-slide-deck').children.length;
var newSlide = (numberOfSlides + slide) % numberOfSlides;
// Show the respective slide. The slide is shown by setting the
// appropriate negative margin on the slide deck.
var margin = '0';
if (slide != 0)
margin = '-' + newSlide * 100 + '%';
$('managed-user-created-slide-deck').style.webkitMarginStart = margin;
// Update the bottom buttons.
$('managed-user-created-small-buttons').children[this.currentSlide_]
.classList.toggle('managed-user-created-small-button-selected');
$('managed-user-created-small-buttons').children[newSlide]
.classList.toggle('managed-user-created-small-button-selected');
this.currentSlide_ = newSlide;
}, },
/** /**
...@@ -130,16 +53,20 @@ cr.define('options', function() { ...@@ -130,16 +53,20 @@ cr.define('options', function() {
* info = { * info = {
* name: "Profile Name", * name: "Profile Name",
* filePath: "/path/to/profile/data/on/disk" * filePath: "/path/to/profile/data/on/disk"
* isManaged: (true|false), * isManaged: (true|false)
* }; * };
* @private * @private
*/ */
setProfileInfo_: function(info) { setProfileInfo_: function(info) {
this.profileInfo_ = info; this.profileInfo_ = info;
$('managed-user-created-title').textContent = $('managed-user-created-title').textContent =
loadTimeData.getStringF('managedUserCreateConfirmTitle', info.name); loadTimeData.getStringF('managedUserCreatedTitle', info.name);
$('managed-user-created-text').textContent =
loadTimeData.getStringF('managedUserCreatedText',
info.name,
loadTimeData.getString('custodianEmail'));
$('managed-user-created-switch').textContent = $('managed-user-created-switch').textContent =
loadTimeData.getStringF('managedUserCreateConfirmSwitch', info.name); loadTimeData.getStringF('managedUserCreatedSwitch', info.name);
}, },
}; };
......
<div id="managed-user-learn-more" class="page" hidden> <div id="managed-user-learn-more" class="page" hidden>
<div class="close-button"></div> <div class="close-button"></div>
<!-- Overlay for the 'Learn more' link when creating a limited user. --> <!-- Overlay for the 'Learn more' link when creating a supervised user. -->
<h1 i18n-content="managedUserLearnMoreTitle"></h1> <h1 i18n-content="managedUserLearnMoreTitle"></h1>
<div class="content-area"> <div class="content-area">
<div id="managed-user-learn-more-image"></div> <div id="managed-user-learn-more-image"></div>
......
...@@ -319,7 +319,7 @@ void ExtensionSettingsHandler::GetLocalizedValues( ...@@ -319,7 +319,7 @@ void ExtensionSettingsHandler::GetLocalizedValues(
source->AddString("extensionSettingsPolicyControlled", source->AddString("extensionSettingsPolicyControlled",
l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED)); l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED));
source->AddString("extensionSettingsManagedMode", source->AddString("extensionSettingsManagedMode",
l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_MANAGED_MODE)); l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_MANAGED_USER));
source->AddString("sideloadWipeoutUrl", source->AddString("sideloadWipeoutUrl",
chrome::kSideloadWipeoutHelpURL); chrome::kSideloadWipeoutHelpURL);
source->AddString("sideloadWipoutLearnMore", source->AddString("sideloadWipoutLearnMore",
......
...@@ -92,13 +92,14 @@ void ManageProfileHandler::GetLocalizedValues( ...@@ -92,13 +92,14 @@ void ManageProfileHandler::GetLocalizedValues(
{ "manageProfilesDuplicateNameError", { "manageProfilesDuplicateNameError",
IDS_PROFILES_MANAGE_DUPLICATE_NAME_ERROR }, IDS_PROFILES_MANAGE_DUPLICATE_NAME_ERROR },
{ "manageProfilesIconLabel", IDS_PROFILES_MANAGE_ICON_LABEL }, { "manageProfilesIconLabel", IDS_PROFILES_MANAGE_ICON_LABEL },
{ "manageProfilesLimitedNotSignedInLabel", { "manageProfilesManagedNotSignedInLabel",
IDS_PROFILES_CREATE_LIMITED_NOT_SIGNED_IN_LABEL }, IDS_PROFILES_CREATE_MANAGED_NOT_SIGNED_IN_LABEL },
{ "manageProfilesLimitedNotSignedInLink", { "manageProfilesManagedNotSignedInLink",
IDS_PROFILES_CREATE_LIMITED_NOT_SIGNED_IN_LINK }, IDS_PROFILES_CREATE_MANAGED_NOT_SIGNED_IN_LINK },
{ "deleteProfileTitle", IDS_PROFILES_DELETE_TITLE }, { "deleteProfileTitle", IDS_PROFILES_DELETE_TITLE },
{ "deleteProfileOK", IDS_PROFILES_DELETE_OK_BUTTON_LABEL }, { "deleteProfileOK", IDS_PROFILES_DELETE_OK_BUTTON_LABEL },
{ "deleteProfileMessage", IDS_PROFILES_DELETE_MESSAGE }, { "deleteProfileMessage", IDS_PROFILES_DELETE_MESSAGE },
{ "deleteManagedProfileAddendum", IDS_PROFILES_DELETE_MANAGED_ADDENDUM },
{ "createProfileTitle", IDS_PROFILES_CREATE_TITLE }, { "createProfileTitle", IDS_PROFILES_CREATE_TITLE },
{ "createProfileInstructions", IDS_PROFILES_CREATE_INSTRUCTIONS }, { "createProfileInstructions", IDS_PROFILES_CREATE_INSTRUCTIONS },
{ "createProfileConfirm", IDS_PROFILES_CREATE_CONFIRM }, { "createProfileConfirm", IDS_PROFILES_CREATE_CONFIRM },
...@@ -396,7 +397,7 @@ void ManageProfileHandler::RequestSignedInText(const base::ListValue* args) { ...@@ -396,7 +397,7 @@ void ManageProfileHandler::RequestSignedInText(const base::ListValue* args) {
string16 text = string16(); string16 text = string16();
if (!username.empty()) { if (!username.empty()) {
text = l10n_util::GetStringFUTF16( text = l10n_util::GetStringFUTF16(
IDS_PROFILES_CREATE_LIMITED_SIGNED_IN_LABEL, username); IDS_PROFILES_CREATE_MANAGED_SIGNED_IN_LABEL, username);
} }
StringValue text_value(text); StringValue text_value(text);
web_ui()->CallJavascriptFunction("CreateProfileOverlay.updateSignedInStatus", web_ui()->CallJavascriptFunction("CreateProfileOverlay.updateSignedInStatus",
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_base.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/startup/startup_types.h" #include "chrome/browser/ui/startup/startup_types.h"
...@@ -31,18 +34,21 @@ void ManagedUserCreateConfirmHandler::GetLocalizedValues( ...@@ -31,18 +34,21 @@ void ManagedUserCreateConfirmHandler::GetLocalizedValues(
DCHECK(localized_strings); DCHECK(localized_strings);
static OptionsStringResource resources[] = { static OptionsStringResource resources[] = {
{"managedUserCreateConfirmTitle", IDS_NEW_LIMITED_USER_SUCCESS_TITLE}, { "managedUserCreatedTitle", IDS_NEW_MANAGED_USER_CREATED_TITLE },
{"managedUserCreateConfirmTextSlide1", { "managedUserCreatedText", IDS_NEW_MANAGED_USER_CREATED_TEXT },
IDS_NEW_LIMITED_USER_SUCCESS_TEXT_SLIDE_1}, { "managedUserCreatedDone", IDS_NEW_MANAGED_USER_CREATED_DONE_BUTTON },
{"managedUserCreateConfirmTextSlide2", { "managedUserCreatedSwitch", IDS_NEW_MANAGED_USER_CREATED_SWITCH_BUTTON },
IDS_NEW_LIMITED_USER_SUCCESS_TEXT_SLIDE_2},
{"managedUserCreateConfirmTextSlide3",
IDS_NEW_LIMITED_USER_SUCCESS_TEXT_SLIDE_3},
{"managedUserCreateConfirmDone", IDS_NEW_LIMITED_USER_SUCCESS_DONE_BUTTON},
{"managedUserCreateConfirmSwitch",
IDS_NEW_LIMITED_USER_SUCCESS_SWITCH_BUTTON},
}; };
SigninManagerBase* signin =
SigninManagerFactory::GetForProfile(Profile::FromWebUI(web_ui()));
if (signin) {
localized_strings->SetString("custodianEmail",
signin->GetAuthenticatedUsername());
} else {
localized_strings->SetString("custodianEmail", std::string());
}
RegisterStrings(localized_strings, resources, arraysize(resources)); RegisterStrings(localized_strings, resources, arraysize(resources));
} }
......
...@@ -20,9 +20,9 @@ void ManagedUserLearnMoreHandler::GetLocalizedValues( ...@@ -20,9 +20,9 @@ void ManagedUserLearnMoreHandler::GetLocalizedValues(
DCHECK(localized_strings); DCHECK(localized_strings);
static OptionsStringResource resources[] = { static OptionsStringResource resources[] = {
{ "managedUserLearnMoreTitle", IDS_NEW_LIMITED_USER_LEARN_MORE_TITLE }, { "managedUserLearnMoreTitle", IDS_NEW_MANAGED_USER_LEARN_MORE_TITLE },
{ "managedUserLearnMoreText", IDS_NEW_LIMITED_USER_LEARN_MORE_TEXT }, { "managedUserLearnMoreText", IDS_NEW_MANAGED_USER_LEARN_MORE_TEXT },
{ "managedUserLearnMoreDone", IDS_NEW_LIMITED_USER_LEARN_MORE_DONE_BUTTON }, { "managedUserLearnMoreDone", IDS_NEW_MANAGED_USER_LEARN_MORE_DONE_BUTTON },
}; };
RegisterStrings(localized_strings, resources, arraysize(resources)); RegisterStrings(localized_strings, resources, arraysize(resources));
......
...@@ -39,8 +39,13 @@ const char kManagedModeManualHosts[] = "profile.managed.manual_hosts"; ...@@ -39,8 +39,13 @@ const char kManagedModeManualHosts[] = "profile.managed.manual_hosts";
const char kManagedModeManualURLs[] = "profile.managed.manual_urls"; const char kManagedModeManualURLs[] = "profile.managed.manual_urls";
// Stores the email address associated with the google account of the custodian // Stores the email address associated with the google account of the custodian
// of the managed user. // of the managed user, set when the managed user is created.
const char kManagedUserCustodian[] = "profile.managed.custodian_email"; const char kManagedUserCustodianEmail[] = "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
// starts a session.
const char kManagedUserCustodianName[] = "profile.managed.custodian_name";
// Used to determine if the last session exited cleanly. Set to false when // Used to determine if the last session exited cleanly. Set to false when
// first opened, and to true when closing. On startup if the value is false, // first opened, and to true when closing. On startup if the value is false,
......
...@@ -23,7 +23,8 @@ extern const char kHomePageIsNewTabPage[]; ...@@ -23,7 +23,8 @@ extern const char kHomePageIsNewTabPage[];
extern const char kHomePage[]; extern const char kHomePage[];
extern const char kManagedModeManualHosts[]; extern const char kManagedModeManualHosts[];
extern const char kManagedModeManualURLs[]; extern const char kManagedModeManualURLs[];
extern const char kManagedUserCustodian[]; extern const char kManagedUserCustodianEmail[];
extern const char kManagedUserCustodianName[];
extern const char kSessionExitedCleanly[]; extern const char kSessionExitedCleanly[];
extern const char kSessionExitType[]; extern const char kSessionExitType[];
extern const char kRestoreOnStartup[]; extern const char kRestoreOnStartup[];
......
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