Commit 89aca929 authored by achuith@chromium.org's avatar achuith@chromium.org

Support for device requisition shark.

BUG=385673
TEST=manual
NOTRY=True

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282157 0039d316-1c4b-4281-b951-d872f2087c98
parent e486cea8
...@@ -5255,7 +5255,10 @@ All users must sign out to continue. ...@@ -5255,7 +5255,10 @@ All users must sign out to continue.
Use this device requisition when enrolling the device for enterprise management: Use this device requisition when enrolling the device for enterprise management:
</message> </message>
<message name="IDS_ENTERPRISE_DEVICE_REQUISITION_REMORA_PROMPT_TEXT" desc="Prompt shown in the device requisition remora prompt popup."> <message name="IDS_ENTERPRISE_DEVICE_REQUISITION_REMORA_PROMPT_TEXT" desc="Prompt shown in the device requisition remora prompt popup.">
Are you sure, you want to set up this device as a Chromebox for Meetings device? Are you sure you want to set up this device as a Chromebox for Meetings device?
</message>
<message name="IDS_ENTERPRISE_DEVICE_REQUISITION_SHARK_PROMPT_TEXT" desc="Prompt shown in the device requisition shark prompt popup.">
Are you sure you want to set up this device as a "Shark"?
</message> </message>
<message name="IDS_ENTERPRISE_ENROLLMENT_STATUS_REGISTRATION_FAILED" desc="Error message shown on the enrollment screen upon failed device registration."> <message name="IDS_ENTERPRISE_ENROLLMENT_STATUS_REGISTRATION_FAILED" desc="Error message shown on the enrollment screen upon failed device registration.">
......
...@@ -62,6 +62,7 @@ const char kAccelFocusPrev[] = "focus_prev"; ...@@ -62,6 +62,7 @@ const char kAccelFocusPrev[] = "focus_prev";
const char kAccelFocusNext[] = "focus_next"; const char kAccelFocusNext[] = "focus_next";
const char kAccelNameDeviceRequisition[] = "device_requisition"; const char kAccelNameDeviceRequisition[] = "device_requisition";
const char kAccelNameDeviceRequisitionRemora[] = "device_requisition_remora"; const char kAccelNameDeviceRequisitionRemora[] = "device_requisition_remora";
const char kAccelNameDeviceRequisitionShark[] = "device_requisition_shark";
const char kAccelNameAppLaunchBailout[] = "app_launch_bailout"; const char kAccelNameAppLaunchBailout[] = "app_launch_bailout";
const char kAccelNameAppLaunchNetworkConfig[] = "app_launch_network_config"; const char kAccelNameAppLaunchNetworkConfig[] = "app_launch_network_config";
...@@ -140,6 +141,10 @@ WebUILoginView::WebUILoginView() ...@@ -140,6 +141,10 @@ WebUILoginView::WebUILoginView()
accel_map_[ accel_map_[
ui::Accelerator(ui::VKEY_H, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = ui::Accelerator(ui::VKEY_H, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] =
kAccelNameDeviceRequisitionRemora; kAccelNameDeviceRequisitionRemora;
accel_map_[
ui::Accelerator(ui::VKEY_H,
ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] =
kAccelNameDeviceRequisitionShark;
accel_map_[ui::Accelerator(ui::VKEY_S, accel_map_[ui::Accelerator(ui::VKEY_S,
ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] =
......
...@@ -35,11 +35,9 @@ namespace policy { ...@@ -35,11 +35,9 @@ namespace policy {
namespace { namespace {
// Overridden no requisition value.
const char kNoRequisition[] = "none"; const char kNoRequisition[] = "none";
// Overridden no requisition value.
const char kRemoraRequisition[] = "remora"; const char kRemoraRequisition[] = "remora";
const char kSharkRequisition[] = "shark";
// These are the machine serial number keys that we check in order until we // These are the machine serial number keys that we check in order until we
// find a non-empty serial number. The VPD spec says the serial number should be // find a non-empty serial number. The VPD spec says the serial number should be
...@@ -141,6 +139,7 @@ std::string DeviceCloudPolicyManagerChromeOS::GetDeviceRequisition() const { ...@@ -141,6 +139,7 @@ std::string DeviceCloudPolicyManagerChromeOS::GetDeviceRequisition() const {
void DeviceCloudPolicyManagerChromeOS::SetDeviceRequisition( void DeviceCloudPolicyManagerChromeOS::SetDeviceRequisition(
const std::string& requisition) { const std::string& requisition) {
VLOG(1) << "SetDeviceRequisition " << requisition;
if (local_state_) { if (local_state_) {
if (requisition.empty()) { if (requisition.empty()) {
local_state_->ClearPref(prefs::kDeviceEnrollmentRequisition); local_state_->ClearPref(prefs::kDeviceEnrollmentRequisition);
...@@ -236,7 +235,8 @@ void DeviceCloudPolicyManagerChromeOS::InitializeRequisition() { ...@@ -236,7 +235,8 @@ void DeviceCloudPolicyManagerChromeOS::InitializeRequisition() {
if (!requisition.empty()) { if (!requisition.empty()) {
local_state_->SetString(prefs::kDeviceEnrollmentRequisition, local_state_->SetString(prefs::kDeviceEnrollmentRequisition,
requisition); requisition);
if (requisition == kRemoraRequisition) { if (requisition == kRemoraRequisition ||
requisition == kSharkRequisition) {
local_state_->SetBoolean(prefs::kDeviceEnrollmentAutoStart, true); local_state_->SetBoolean(prefs::kDeviceEnrollmentAutoStart, true);
local_state_->SetBoolean(prefs::kDeviceEnrollmentCanExit, false); local_state_->SetBoolean(prefs::kDeviceEnrollmentCanExit, false);
} else { } else {
......
...@@ -38,6 +38,7 @@ const char kDeviceTypeMouse[] = "mouse"; ...@@ -38,6 +38,7 @@ const char kDeviceTypeMouse[] = "mouse";
const char kInputControl[] = "/opt/google/input/inputcontrol"; const char kInputControl[] = "/opt/google/input/inputcontrol";
const char kRemoraRequisition[] = "remora"; const char kRemoraRequisition[] = "remora";
const char kSharkRequisition[] = "shark";
typedef base::RefCountedData<bool> RefCountedBool; typedef base::RefCountedData<bool> RefCountedBool;
...@@ -247,10 +248,9 @@ bool InputDeviceSettingsImpl::ForceKeyboardDrivenUINavigation() { ...@@ -247,10 +248,9 @@ bool InputDeviceSettingsImpl::ForceKeyboardDrivenUINavigation() {
if (!policy_manager) if (!policy_manager)
return false; return false;
if (base::strcasecmp(policy_manager->GetDeviceRequisition().c_str(), const std::string requisition = policy_manager->GetDeviceRequisition();
kRemoraRequisition) == 0) { if (requisition == kRemoraRequisition || requisition == kSharkRequisition)
return true; return true;
}
bool keyboard_driven = false; bool keyboard_driven = false;
if (chromeos::system::StatisticsProvider::GetInstance()->GetMachineFlag( if (chromeos::system::StatisticsProvider::GetInstance()->GetMachineFlag(
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
/** @const */ var ACCELERATOR_DEVICE_REQUISITION = 'device_requisition'; /** @const */ var ACCELERATOR_DEVICE_REQUISITION = 'device_requisition';
/** @const */ var ACCELERATOR_DEVICE_REQUISITION_REMORA = /** @const */ var ACCELERATOR_DEVICE_REQUISITION_REMORA =
'device_requisition_remora'; 'device_requisition_remora';
/** @const */ var ACCELERATOR_DEVICE_REQUISITION_SHARK =
'device_requisition_shark';
/** @const */ var ACCELERATOR_APP_LAUNCH_BAILOUT = 'app_launch_bailout'; /** @const */ var ACCELERATOR_APP_LAUNCH_BAILOUT = 'app_launch_bailout';
/** @const */ var ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG = /** @const */ var ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG =
'app_launch_network_config'; 'app_launch_network_config';
...@@ -357,7 +359,12 @@ cr.define('cr.ui.login', function() { ...@@ -357,7 +359,12 @@ cr.define('cr.ui.login', function() {
this.showDeviceRequisitionPrompt_(); this.showDeviceRequisitionPrompt_();
} else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) { } else if (name == ACCELERATOR_DEVICE_REQUISITION_REMORA) {
if (this.isOobeUI()) if (this.isOobeUI())
this.showDeviceRequisitionRemoraPrompt_(); this.showDeviceRequisitionRemoraPrompt_(
'deviceRequisitionRemoraPromptText', 'remora');
} else if (name == ACCELERATOR_DEVICE_REQUISITION_SHARK) {
if (this.isOobeUI())
this.showDeviceRequisitionRemoraPrompt_(
'deviceRequisitionSharkPromptText', 'shark');
} else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) { } else if (name == ACCELERATOR_APP_LAUNCH_BAILOUT) {
if (currentStepId == SCREEN_APP_LAUNCH_SPLASH) if (currentStepId == SCREEN_APP_LAUNCH_SPLASH)
chrome.send('cancelAppLaunch'); chrome.send('cancelAppLaunch');
...@@ -776,10 +783,10 @@ cr.define('cr.ui.login', function() { ...@@ -776,10 +783,10 @@ cr.define('cr.ui.login', function() {
}, },
/** /**
* Shows the special remora device requisition prompt. * Shows the special remora/shark device requisition prompt.
* @private * @private
*/ */
showDeviceRequisitionRemoraPrompt_: function() { showDeviceRequisitionRemoraPrompt_: function(promptText, requisition) {
if (!this.deviceRequisitionRemoraDialog_) { if (!this.deviceRequisitionRemoraDialog_) {
this.deviceRequisitionRemoraDialog_ = this.deviceRequisitionRemoraDialog_ =
new cr.ui.dialogs.ConfirmDialog(document.body); new cr.ui.dialogs.ConfirmDialog(document.body);
...@@ -789,9 +796,9 @@ cr.define('cr.ui.login', function() { ...@@ -789,9 +796,9 @@ cr.define('cr.ui.login', function() {
loadTimeData.getString('deviceRequisitionRemoraPromptCancel')); loadTimeData.getString('deviceRequisitionRemoraPromptCancel'));
} }
this.deviceRequisitionRemoraDialog_.show( this.deviceRequisitionRemoraDialog_.show(
loadTimeData.getString('deviceRequisitionRemoraPromptText'), loadTimeData.getString(promptText),
function() { // onShow function() { // onShow
chrome.send('setDeviceRequisition', ['remora']); chrome.send('setDeviceRequisition', [requisition]);
}, },
function() { // onCancel function() { // onCancel
chrome.send('setDeviceRequisition', ['none']); chrome.send('setDeviceRequisition', ['none']);
......
...@@ -98,6 +98,8 @@ void CoreOobeHandler::DeclareLocalizedValues(LocalizedValuesBuilder* builder) { ...@@ -98,6 +98,8 @@ void CoreOobeHandler::DeclareLocalizedValues(LocalizedValuesBuilder* builder) {
IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL); IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL);
builder->Add("deviceRequisitionRemoraPromptText", builder->Add("deviceRequisitionRemoraPromptText",
IDS_ENTERPRISE_DEVICE_REQUISITION_REMORA_PROMPT_TEXT); IDS_ENTERPRISE_DEVICE_REQUISITION_REMORA_PROMPT_TEXT);
builder->Add("deviceRequisitionSharkPromptText",
IDS_ENTERPRISE_DEVICE_REQUISITION_SHARK_PROMPT_TEXT);
} }
void CoreOobeHandler::Initialize() { void CoreOobeHandler::Initialize() {
......
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