Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: chrome/browser/chromeos/login/ui/webui_login_view.cc

Issue 2898003002: Allow the powerwash shortcut only for devices without FRE (Closed)
Patch Set: Fixed review comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/ui/webui_login_view.cc
diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.cc b/chrome/browser/chromeos/login/ui/webui_login_view.cc
index 89d498dadc72af31b2a078d34a82500c8123f723..d172146ce3debf75384cdca238733b49bd7e7cf5 100644
--- a/chrome/browser/chromeos/login/ui/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_util.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
+#include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
#include "chrome/browser/chromeos/login/ui/preloaded_web_view.h"
#include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h"
@@ -60,6 +61,7 @@
#include "ui/views/controls/webview/webview.h"
#include "ui/views/widget/widget.h"
+using chromeos::AutoEnrollmentController;
using content::NativeWebKeyboardEvent;
using content::RenderViewHost;
using content::WebContents;
@@ -141,9 +143,17 @@ WebUILoginView::WebUILoginView(const WebViewSettings& settings)
}
accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN)] =
kAccelNameVersion;
- accel_map_[ui::Accelerator(ui::VKEY_R,
- ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] =
- kAccelNameReset;
+
+ // Devices with forced re-enrollment enabled shouldn't be able to powerwash.
+ const AutoEnrollmentController::FRERequirement requirement =
+ AutoEnrollmentController::GetFRERequirement();
+ if (requirement == AutoEnrollmentController::NOT_REQUIRED ||
+ requirement == AutoEnrollmentController::EXPLICITLY_NOT_REQUIRED) {
+ accel_map_[ui::Accelerator(ui::VKEY_R,
+ ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN |
+ ui::EF_SHIFT_DOWN)] = kAccelNameReset;
+ }
+
accel_map_[ui::Accelerator(ui::VKEY_X,
ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] =
kAccelNameEnableDebugging;
« no previous file with comments | « chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698