Commit 2fc03ddb authored by bauerb@chromium.org's avatar bauerb@chromium.org

Add a "managed user settings" page to chrome://settings.

It's only accessible at chrome://settings/managedUser and requires the --enable-managed-users switch.

Also, not all of the settings are hooked up yet.

TBR=ben@chromium.org,cpu@chromium.org
BUG=163884


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171065 0039d316-1c4b-4281-b951-d872f2087c98
parent 06ce0884
......@@ -8055,6 +8055,47 @@ The following plug-in is unresponsive: <ph name="PLUGIN_NAME">$1
Clearing...
</message>
<!-- Managed User Settings dialog data -->
<message name="IDS_MANAGED_USER_SETTINGS_TITLE" desc="Title for the Managed User Settings dialog">
Managed User Settings
</message>
<message name="IDS_INSTALLED_CONTENT_PACKS_LABEL" desc="Label for installed whitelists on the Managed User Settings dialog">
Installed and enabled content packs:
</message>
<message name="IDS_GET_CONTENT_PACKS_BUTTON" desc="The text for the button that opens the webstore, Content pack section.">
Get Content Packs
</message>
<message name="IDS_CONTENT_PACK_SETTINGS_LABEL" desc="Label that explains the three options associated with installed whitelists on the Managed User Settings dialog">
When a managed user tries to access a site that is not in any content pack:
</message>
<message name="IDS_OUTSIDE_CONTENT_PACKS_ALLOW_RADIO" desc="A radio button in the Managed User Settings dialog for allowing a managed user to view sites that do not belong to the installed whitelists.">
Allow
</message>
<message name="IDS_OUTSIDE_CONTENT_PACKS_WARN_RADIO" desc="A radio button in the Managed User Settings dialog for warning a managed user whenever they try to view sites that do not belong to the installed whitelist.">
Warn
</message>
<message name="IDS_OUTSIDE_CONTENT_PACKS_BLOCK_RADIO" desc="A radio button in the Managed User Settings dialog for blocking a managed user to view sites that do not belong to the installed whitelist.">
Block
</message>
<message name="IDS_ADVANCED_MANAGED_USER_LABEL" desc="A label in the Managed User Settings dialog for other managed user settings.">
Advanced settings
</message>
<message name="IDS_SAFE_SEARCH_ENABLED" desc="A checkbox in the Managed User Settings dialog for enabling SafeSearch">
Enable Google's SafeSearch
</message>
<message name="IDS_SIGNIN_SYNC_DISABLED" desc="A checkbox in the Managed User Settings dialog for disabling sign in or sync.">
Disable signing into Chrome
</message>
<message name="IDS_HISTORY_DELETION_DISABLED" desc="A checkbox in the Managed User Settings dialog for tracking history of managed user.">
Disable incognito windows and deleting history
</message>
<message name="IDS_USE_PASSPHRASE_LABEL" desc="A checkbox in the Managed User Settings dialog to set whether to ask for a passphrase to access other profiles.">
Use a passphrase to leave managed mode
</message>
<message name="IDS_SET_PASSPHRASE_BUTTON" desc="A button in the Managed User Settings dialog to set the passphrase to access other profiles">
Set passphrase
</message>
<!-- Managed Mode Block Interstitial data -->
<message name="IDS_BLOCK_INTERSTITIAL_TITLE" desc="A title for the managed mode block interstitial page.">
Sad Robot
......
......@@ -352,6 +352,11 @@
https://chrome.google.com/webstore?hl=[GRITLANGCODE]&amp;category=theme
</message>
<!-- The URL for the content packs gallery. -->
<message name="IDS_GET_CONTENT_PACKS_URL" translateable="false">
https://chrome.google.com/webstore?hl=[GRITLANGCODE]
</message>
<!-- The URL for the webstore. -->
<message name="IDS_WEBSTORE_URL" translateable="false">
https://chrome.google.com/webstore?hl=[GRITLANGCODE]
......
/* Copyright (c) 2012 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. */
#managed-user-settings-page {
min-width: 600px;
}
/* Content Packs list */
#content-packs-list {
margin-bottom: 10px;
min-height: 0;
}
<div id="managed-user-settings-page" class="page" hidden>
<div class="close-button"></div>
<h1 i18n-content="managedUserSettingsPage"></h1>
<div class="content-area">
<!-- Content pack area -->
<section>
<h3 i18n-content="installedContentPacks"></h3>
<list id="content-packs-list"></list>
<div class="settings-row">
<button id="get-content-packs-button" i18n-content="getContentPacks">
</div>
</section>
<!-- Content pack settings -->
<section>
<h3 i18n-content="contentPackSettings"></h3>
<div class="radio">
<label>
<input type="radio" name="contentpacks" value="0"
id="contentpacks-allow"
pref="profile.managed.default_filtering_behavior">
<span for="contentpacks-allow"
i18n-content="outsideContentPacksAllow"></span>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="contentpacks" value="1"
id="contentpacks-warn"
pref="profile.managed.default_filtering_behavior">
<span for="contentpacks-warn"
i18n-content="outsideContentPacksWarn"></span>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="contentpacks" value="2"
id="contentpacks-block"
pref="profile.managed.default_filtering_behavior">
<span for="contentpacks-block"
i18n-content="outsideContentPacksBlock"></span>
</label>
</div>
</section>
<!-- Advanced Settings -->
<section>
<h3 i18n-content="advancedManagedUserSettings"></h3>
<div class="checkbox">
<label>
<input type="checkbox" id="safe-search-checkbox"
pref="settings.force_safesearch">
<span for="safe-search-checkbox"
i18n-content="enableSafeSearch"></span>
</label>
</div>
<div class="checkbox">
<label>
<input id="disable-signin-checkbox" type="checkbox">
<span for="disable-signin-checkbox"
i18n-content="disableProfileSignIn"></span>
</label>
</div>
<div class="checkbox">
<label>
<input id="disable-history-deletion-checkbox" type="checkbox">
<span for="disable-history-deletion-checkbox"
i18n-content="disableHistoryDeletion"></span>
</label>
</div>
<div class="checkbox">
<label>
<input id="use-passphrase-checkbox" type="checkbox">
<span for="use-passphrase-checkbox"
i18n-content="usePassphrase"></span>
</label>
<button id="set-passphrase" class="link-button"
i18n-content="setPassphrase">
</div>
</section>
</div>
<div class="action-area">
<div class="button-strip">
<button id="managed-user-settings-confirm" type="submit"
i18n-content="ok">
</div>
</div>
</div>
// Copyright (c) 2012 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.
if (loadTimeData.getBoolean('managedUsersEnabled')) {
cr.define('options', function() {
/** @const */ var OptionsPage = options.OptionsPage;
//////////////////////////////////////////////////////////////////////////////
// ManagedUserSettings class:
/**
* Encapsulated handling of the Managed User Settings page.
* @constructor
* @class
*/
function ManagedUserSettings() {
OptionsPage.call(
this,
'manageduser',
loadTimeData.getString('managedUserSettingsPageTabTitle'),
'managed-user-settings-page');
}
cr.addSingletonGetter(ManagedUserSettings);
ManagedUserSettings.prototype = {
// Inherit from OptionsPage.
__proto__: OptionsPage.prototype,
/**
* Initialize the page.
* @override
*/
initializePage: function() {
// Call base class implementation to start preference initialization.
OptionsPage.prototype.initializePage.call(this);
$('get-content-packs-button').onclick = function(event) {
window.open(loadTimeData.getString('getContentPacksURL'));
};
$('managed-user-settings-confirm').onclick = function() {
OptionsPage.closeOverlay();
};
$('set-passphrase').onclick = function() {
// TODO(bauerb): Set passphrase
};
},
};
// Export
return {
ManagedUserSettings: ManagedUserSettings
};
});
}
......@@ -20,6 +20,7 @@
<link rel="stylesheet" href="content_settings.css">
<link rel="stylesheet" href="cookies_view.css">
<link rel="stylesheet" href="do_not_track_confirm_overlay.css">
<link rel="stylesheet" href="managed_user_settings.css">
<link rel="stylesheet" href="font_settings.css">
<link rel="stylesheet" href="handler_options.css">
<link rel="stylesheet" href="home_page_overlay.css">
......@@ -92,6 +93,7 @@
<include src="content_settings.html">
<include src="content_settings2.html">
<include src="do_not_track_confirm_overlay.html">
<include src="managed_user_settings.html">
<include src="font_settings.html">
<include src="home_page_overlay.html">
<include src="import_data_overlay.html">
......
......@@ -17,6 +17,7 @@ var CookiesViewApp = options.CookiesViewApp;
var CookiesView = options.CookiesView;
var EditDictionaryOverlay = cr.IsMac ? null : options.EditDictionaryOverlay;
var FactoryResetOverlay = options.FactoryResetOverlay;
var ManagedUserSettings = options.ManagedUserSettings;
var FontSettings = options.FontSettings;
var HandlerOptions = options.HandlerOptions;
var HomePageOverlay = options.HomePageOverlay;
......@@ -143,6 +144,11 @@ function load() {
[$('language-button')]);
OptionsPage.registerOverlay(ManageProfileOverlay.getInstance(),
BrowserOptions.getInstance());
if (loadTimeData.getBoolean('managedUsersEnabled')) {
OptionsPage.registerOverlay(ManagedUserSettings.getInstance(),
BrowserOptions.getInstance(),
[]);
}
OptionsPage.registerOverlay(MediaGalleriesManager.getInstance(),
ContentSettings.getInstance(),
[$('manage-galleries-button')]);
......
......@@ -73,6 +73,7 @@
<include src="cookies_view.js"></include>
<include src="cookies_view_app.js"></include>
<include src="factory_reset_overlay.js"></include>
<include src="managed_user_settings.js"></include>
<include src="font_settings.js"></include>
<include src="handler_options.js"></include>
<include src="handler_options_list.js"></include>
......
// Copyright (c) 2012 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_settings_handler.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/values.h"
#include "chrome/common/chrome_switches.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
namespace options {
ManagedUserSettingsHandler::ManagedUserSettingsHandler() {
}
ManagedUserSettingsHandler::~ManagedUserSettingsHandler() {
}
void ManagedUserSettingsHandler::GetLocalizedValues(
base::DictionaryValue* localized_strings) {
DCHECK(localized_strings);
static OptionsStringResource resources[] = {
// Installed content packs.
{ "installedContentPacks", IDS_INSTALLED_CONTENT_PACKS_LABEL },
{ "getContentPacks", IDS_GET_CONTENT_PACKS_BUTTON },
{ "getContentPacksURL", IDS_GET_CONTENT_PACKS_URL },
// Content pack restriction options.
{ "contentPackSettings", IDS_CONTENT_PACK_SETTINGS_LABEL },
{ "outsideContentPacksAllow", IDS_OUTSIDE_CONTENT_PACKS_ALLOW_RADIO },
{ "outsideContentPacksWarn", IDS_OUTSIDE_CONTENT_PACKS_WARN_RADIO },
{ "outsideContentPacksBlock", IDS_OUTSIDE_CONTENT_PACKS_BLOCK_RADIO },
// Other managed user settings
{ "advancedManagedUserSettings", IDS_ADVANCED_MANAGED_USER_LABEL },
{ "enableSafeSearch", IDS_SAFE_SEARCH_ENABLED },
{ "disableProfileSignIn", IDS_SIGNIN_SYNC_DISABLED },
{ "disableHistoryDeletion", IDS_HISTORY_DELETION_DISABLED },
{ "usePassphrase", IDS_USE_PASSPHRASE_LABEL },
{ "setPassphrase", IDS_SET_PASSPHRASE_BUTTON }
};
RegisterStrings(localized_strings, resources, arraysize(resources));
RegisterTitle(localized_strings, "managedUserSettingsPage",
IDS_MANAGED_USER_SETTINGS_TITLE);
localized_strings->SetBoolean(
"managedUsersEnabled",
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableManagedUsers));
}
} // namespace options
// Copyright (c) 2012 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_SETTINGS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_
#include "chrome/browser/ui/webui/options/options_ui.h"
namespace options {
class ManagedUserSettingsHandler : public OptionsPageUIHandler {
public:
ManagedUserSettingsHandler();
virtual ~ManagedUserSettingsHandler();
// OptionsPageUIHandler implementation.
virtual void GetLocalizedValues(
base::DictionaryValue* localized_strings) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(ManagedUserSettingsHandler);
};
} // namespace options
#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_SETTINGS_HANDLER_H_
......@@ -36,6 +36,7 @@
#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_settings_handler.h"
#include "chrome/browser/ui/webui/options/media_devices_selection_handler.h"
#include "chrome/browser/ui/webui/options/media_galleries_handler.h"
#include "chrome/browser/ui/webui/options/options_sync_setup_handler.h"
......@@ -253,6 +254,7 @@ OptionsUI::OptionsUI(content::WebUI* web_ui)
AddOptionsPageUIHandler(localized_strings,
new LanguageDictionaryOverlayHandler());
AddOptionsPageUIHandler(localized_strings, new ManageProfileHandler());
AddOptionsPageUIHandler(localized_strings, new ManagedUserSettingsHandler());
AddOptionsPageUIHandler(localized_strings, new PasswordManagerHandler());
AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler());
AddOptionsPageUIHandler(localized_strings, new ImportDataHandler());
......
......@@ -2000,6 +2000,8 @@
'browser/ui/webui/options/language_options_handler.h',
'browser/ui/webui/options/language_options_handler_common.cc',
'browser/ui/webui/options/language_options_handler_common.h',
'browser/ui/webui/options/managed_user_settings_handler.cc',
'browser/ui/webui/options/managed_user_settings_handler.h',
'browser/ui/webui/options/manage_profile_handler.cc',
'browser/ui/webui/options/manage_profile_handler.h',
'browser/ui/webui/options/media_devices_selection_handler.cc',
......
......@@ -555,6 +555,10 @@ const char kEnableIPPooling[] = "enable-ip-pooling";
// flag can be used to enable it until http://crbug.com/108992 is fixed.
extern const char kEnableManagedStorage[] = "enable-managed-storage";
// Enables support for user profiles that are managed by another user and can
// have restrictions applied.
extern const char kEnableManagedUsers[] = "enable-managed-users";
// Allows reporting memory info (JS heap size) to page.
const char kEnableMemoryInfo[] = "enable-memory-info";
......
......@@ -158,6 +158,7 @@ extern const char kEnableIPCFuzzing[];
extern const char kEnableIPPooling[];
extern const char kEnableIPv6[];
extern const char kEnableManagedStorage[];
extern const char kEnableManagedUsers[];
extern const char kEnableMemoryInfo[];
extern const char kEnableMetricsReportingForTesting[];
extern const char kEnableNaCl[];
......
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