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

Unified Diff: chrome/browser/chromeos/login/enrollment/enrollment_screen.cc

Issue 2842163002: Restart browser after Chromad enrollment (Closed)
Patch Set: Restart browser after Chromad enrollment Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
diff --git a/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc b/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
index 2376f691086bc2ca4c3535718af3a9b227d13c08..ee08d9c854280f997194d4f073008023401461bf 100644
--- a/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
+++ b/chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "chrome/browser/lifetime/application_lifetime.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/dbus_thread_manager.h"
@@ -248,6 +249,16 @@ void EnrollmentScreen::OnCancel() {
void EnrollmentScreen::OnConfirmationClosed() {
ClearAuth(base::Bind(&EnrollmentScreen::Finish, base::Unretained(this),
ScreenExitCode::ENTERPRISE_ENROLLMENT_COMPLETED));
+ // Restart browser to switch from DeviceCloudPolicyManagerChromeOS to
+ // DeviceActiveDirectoryPolicyManager.
+ if (g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->IsActiveDirectoryManaged()) {
+ // TODO(tnagel): Refactor BrowserPolicyConnectorChromeOS so that device
+ // policy providers are only registered after enrollment has finished and
+ // thus the correct one can be picked without restarting the browser.
+ chrome::AttemptRestart();
+ }
}
void EnrollmentScreen::OnAdJoined(const std::string& realm) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698