Enrollment logic was extracted from EnrollmentScreen(Handler) in a helper class.
commitb790385be31372a06a1fbc03245325786e2596c0
authordzhioev <dzhioev@chromium.org>
Wed, 26 Nov 2014 14:18:22 +0000 (26 06:18 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 26 Nov 2014 14:18:40 +0000 (26 14:18 +0000)
treee41636a8ab0ff57f0fcba88d250bca9bed929880
parent2f574010b94f261a6dd8d04693e2b03ef991a525
Enrollment logic was extracted from EnrollmentScreen(Handler) in a helper class.

The new class contains the code that retrieves tokens from
profile (moved from EnrollmentScreenHandler), the code that starts
enrollment given a token (moved from EnrollmentScreen), the code
that reports UMA related to tokens fetch and enrollment (moved from
EnrollmentScreen) and the code that cleans profile of authentication
data and revokes tokens if enrollment failed for some reason (moved
from EnrollmentScreenHandler).

EnterpriseEnrollmentHelper provides two entry points:
* EnrollUsingContext, that receives profile containing authentication data.
* EnrollUsingToken, that receives authentication token.

The main reason for this change, is that enrollment functionality
is needed during host/controller pairing. So if we want to avoid
code duplication, we need to extract enrollment code somewhere.

The second reason, EnrollmentScreenHandler is supposed to be a purely UI class.

This CL doesn't change behavior, everything is supposed to work as it worked before.

BUG=405150
TEST=manually,enrollment works,hotrod enrollment works

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

Cr-Commit-Position: refs/heads/master@{#305807}
18 files changed:
chrome/browser/chromeos/login/enrollment/enrollment_mode.cc [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/enrollment_mode.h [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/enrollment_screen.cc
chrome/browser/chromeos/login/enrollment/enrollment_screen.h
chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h
chrome/browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc
chrome/browser/chromeos/login/enrollment/enrollment_uma.cc [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/enrollment_uma.h [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.cc [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.h [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.h [new file with mode: 0644]
chrome/browser/chromeos/login/enrollment/mock_enrollment_screen.h
chrome/browser/chromeos/login/wizard_controller.cc
chrome/browser/chromeos/login/wizard_controller_browsertest.cc
chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h
chrome/chrome_browser_chromeos.gypi