summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidyu@chromium.org <davidyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 12:25:13 +0000
committerdavidyu@chromium.org <davidyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 12:25:13 +0000
commit3170e9ab03724efc5602a95389927acaa3fb722f (patch)
tree71594ed6f2aa2e8b9e05004cfa9352e0c21b21cf
parent29a0d6ddb6cd2748fef573393b160d36fc8c4451 (diff)
downloadchromium_src-3170e9ab03724efc5602a95389927acaa3fb722f.zip
chromium_src-3170e9ab03724efc5602a95389927acaa3fb722f.tar.gz
chromium_src-3170e9ab03724efc5602a95389927acaa3fb722f.tar.bz2
Add a command line switch --enable-consumer-management.
Add a security section and a consumer management enroll button in the settings page and make it hidden behind the command line switch. Rename the original security section in the settings page to "certificates", as that is what it is. BUG=353050 TEST=manual Review URL: https://codereview.chromium.org/234583003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264480 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chromeos_strings.grdp11
-rw-r--r--chrome/app/generated_resources.grd2
-rw-r--r--chrome/browser/chromeos/login/chrome_restart_request.cc1
-rw-r--r--chrome/browser/resources/options/browser_options.html13
-rw-r--r--chrome/browser/resources/options/browser_options.js9
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc23
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.h3
-rw-r--r--chromeos/chromeos_switches.cc4
-rw-r--r--chromeos/chromeos_switches.h1
9 files changed, 63 insertions, 4 deletions
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index 53784dd..1f632bb 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -5498,4 +5498,15 @@ All users must sign out to continue.
Failed to submit NDEF:
</message>
+ <!-- About the security section in the settings page -->
+ <message name="IDS_OPTIONS_SECURITY_SECTION_TITLE" desc="The title of the security section in the settings page.">
+ Security
+ </message>
+ <message name="IDS_OPTIONS_CONSUMER_MANAGEMENT_ENROLL_DESCRIPTION" desc="Description of the consumer management enroll button in the settings page.">
+ Let Google help you remotely lock, erase, and locate your device.
+ </message>
+ <message name="IDS_OPTIONS_CONSUMER_MANAGEMENT_ENROLL_BUTTON" desc="The text of the consumer management enroll button in the settings page.">
+ Enroll
+ </message>
+
</grit-part>
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 22cfce8..4f4a4b2 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -12006,7 +12006,7 @@ Some features may be unavailable. Please check that the profile exists and you
<message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT">
Web content
</message>
- <message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY">
+ <message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_CERTIFICATES">
HTTPS/SSL
</message>
<message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK">
diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc
index b1fc38e..317615d 100644
--- a/chrome/browser/chromeos/login/chrome_restart_request.cc
+++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
@@ -200,6 +200,7 @@ std::string DeriveCommandLine(const GURL& start_url,
cc::switches::kUIDisablePartialSwap,
chromeos::switches::kDbusStub,
chromeos::switches::kDisableLoginAnimations,
+ chromeos::switches::kEnableConsumerManagement,
chromeos::switches::kHasChromeOSDiamondKey,
chromeos::switches::kHasChromeOSKeyboard,
chromeos::switches::kLoginProfile,
diff --git a/chrome/browser/resources/options/browser_options.html b/chrome/browser/resources/options/browser_options.html
index 67a448e..4cea7dc 100644
--- a/chrome/browser/resources/options/browser_options.html
+++ b/chrome/browser/resources/options/browser_options.html
@@ -219,6 +219,17 @@
</div>
</div>
</section>
+
+ <section id="security-section" hidden>
+ <h3 i18n-content="securityTitle"></h3>
+ <div class="settings-row">
+ <span i18n-content="consumerManagementEnrollDescription"></span>
+ </div>
+ <div class="settings-row">
+ <button id="consumer-management-enroll-button"
+ i18n-content="consumerManagementEnrollButton"></button>
+ </div>
+ </section>
</if>
<section id="privacy-section">
<h3 i18n-content="advancedSectionTitlePrivacy"></h3>
@@ -633,7 +644,7 @@
</div>
</section>
<section>
- <h3 i18n-content="advancedSectionTitleSecurity"></h3>
+ <h3 i18n-content="advancedSectionTitleCertificates"></h3>
<div>
<if expr="use_nss or is_win or is_macosx">
<div class="settings-row">
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 6968042..45ff063 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -397,6 +397,15 @@ cr.define('options', function() {
};
}
+ // Security section.
+ if (cr.isChromeOS &&
+ loadTimeData.getBoolean('consumerManagementEnabled')) {
+ $('security-section').hidden = false;
+ $('consumer-management-enroll-button').onclick = function(event) {
+ chrome.send('enrollConsumerManagement');
+ };
+ }
+
// Easy Unlock section.
if (loadTimeData.getBoolean('easyUnlockEnabled')) {
$('easy-unlock-section').hidden = false;
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 2f68fd0..2df07bb 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -181,6 +181,8 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
static OptionsStringResource resources[] = {
{ "advancedSectionTitleCloudPrint", IDS_GOOGLE_CLOUD_PRINT },
{ "currentUserOnly", IDS_OPTIONS_CURRENT_USER_ONLY },
+ { "advancedSectionTitleCertificates",
+ IDS_OPTIONS_ADVANCED_SECTION_TITLE_CERTIFICATES },
{ "advancedSectionTitleContent",
IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT },
{ "advancedSectionTitleLanguages",
@@ -189,8 +191,6 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK },
{ "advancedSectionTitlePrivacy",
IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY },
- { "advancedSectionTitleSecurity",
- IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY },
{ "autofillEnabled", IDS_OPTIONS_AUTOFILL_ENABLE },
{ "autologinEnabled", IDS_OPTIONS_PASSWORDS_AUTOLOGIN },
{ "autoOpenFileTypesInfo", IDS_OPTIONS_OPEN_FILE_TYPES_AUTOMATICALLY },
@@ -368,6 +368,10 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_LONG },
{ "autoclickDelayVeryLong",
IDS_OPTIONS_SETTINGS_ACCESSIBILITY_AUTOCLICK_DELAY_VERY_LONG },
+ { "consumerManagementEnrollButton",
+ IDS_OPTIONS_CONSUMER_MANAGEMENT_ENROLL_BUTTON },
+ { "consumerManagementEnrollDescription",
+ IDS_OPTIONS_CONSUMER_MANAGEMENT_ENROLL_DESCRIPTION },
{ "enableContentProtectionAttestation",
IDS_OPTIONS_ENABLE_CONTENT_PROTECTION_ATTESTATION },
{ "factoryResetHeading", IDS_OPTIONS_FACTORY_RESET_HEADING },
@@ -391,6 +395,7 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
{ "noPointingDevices", IDS_OPTIONS_NO_POINTING_DEVICES },
{ "sectionTitleDevice", IDS_OPTIONS_DEVICE_GROUP_NAME },
{ "sectionTitleInternet", IDS_OPTIONS_INTERNET_OPTIONS_GROUP_LABEL },
+ { "securityTitle", IDS_OPTIONS_SECURITY_SECTION_TITLE },
{ "syncOverview", IDS_SYNC_OVERVIEW },
{ "syncButtonTextStart", IDS_SYNC_SETUP_BUTTON_LABEL },
{ "timezone", IDS_OPTIONS_SETTINGS_TIMEZONE_DESCRIPTION },
@@ -577,6 +582,11 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
l10n_util::GetStringFUTF16(
IDS_OPTIONS_EASY_UNLOCK_CHECKBOX_LABEL_CHROMEOS,
chromeos::GetChromeDeviceType()));
+
+ values->SetBoolean(
+ "consumerManagementEnabled",
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableConsumerManagement));
#endif
}
@@ -659,6 +669,10 @@ void BrowserOptionsHandler::RegisterMessages() {
"performFactoryResetRestart",
base::Bind(&BrowserOptionsHandler::PerformFactoryResetRestart,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "enrollConsumerManagement",
+ base::Bind(&BrowserOptionsHandler::HandleEnrollConsumerManagement,
+ base::Unretained(this)));
#else
web_ui()->RegisterMessageCallback(
"restartBrowser",
@@ -1548,6 +1562,11 @@ void BrowserOptionsHandler::PerformFactoryResetRestart(
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
}
+void BrowserOptionsHandler::HandleEnrollConsumerManagement(
+ const base::ListValue* args) {
+ // TODO(davidyu): Implement. http://crbug.com/353050.
+}
+
void BrowserOptionsHandler::SetupAccessibilityFeatures() {
PrefService* pref_service = g_browser_process->local_state();
base::FundamentalValue virtual_keyboard_enabled(
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.h b/chrome/browser/ui/webui/options/browser_options_handler.h
index d935c27..a705338 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.h
+++ b/chrome/browser/ui/webui/options/browser_options_handler.h
@@ -282,6 +282,9 @@ class BrowserOptionsHandler
// Called when the user confirmed factory reset. Chrome will
// initiate asynchronous file operation and then log out.
void PerformFactoryResetRestart(const base::ListValue* args);
+
+ // Called when the consumer management enroll button is clicked.
+ void HandleEnrollConsumerManagement(const base::ListValue* args);
#endif
// Setup the visibility for the metrics reporting setting.
diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc
index dca8f8a..c5c9837 100644
--- a/chromeos/chromeos_switches.cc
+++ b/chromeos/chromeos_switches.cc
@@ -65,6 +65,10 @@ const char kEchoExtensionPath[] = "echo-ext-path";
// Enables switching between different cellular carriers from the UI.
const char kEnableCarrierSwitching[] = "enable-carrier-switching";
+// Enables consumer management, which allows user to enroll, remotely lock and
+// locate the device.
+const char kEnableConsumerManagement[] = "enable-consumer-management";
+
// Enables MTP support in Files.app.
const char kEnableFileManagerMTP[] = "enable-filemanager-mtp";
diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h
index e56ce7a..62ab183 100644
--- a/chromeos/chromeos_switches.h
+++ b/chromeos/chromeos_switches.h
@@ -37,6 +37,7 @@ CHROMEOS_EXPORT extern const char kDisableQuickofficeComponentApp[];
CHROMEOS_EXPORT extern const char kDisableVolumeAdjustSound[];
CHROMEOS_EXPORT extern const char kEchoExtensionPath[];
CHROMEOS_EXPORT extern const char kEnableCarrierSwitching[];
+CHROMEOS_EXPORT extern const char kEnableConsumerManagement[];
CHROMEOS_EXPORT extern const char kEnableFileManagerMTP[];
CHROMEOS_EXPORT extern const char kEnableKioskMode[];
CHROMEOS_EXPORT extern const char kEnableNetworkPortalNotification[];