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

Side by Side Diff: chrome/browser/chromeos/policy/consumer_enrollment_handler.h

Issue 733613005: Move the notification part out of ConsumerEnrollmentHandler so that it can be reused for unenrollme… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enroll
Patch Set: Added a check for UserManager. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_ENROLLMENT_HANDLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_ENROLLMENT_HANDLER_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_ENROLLMENT_HANDLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_ENROLLMENT_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 const base::Time& expiration_time) override; 46 const base::Time& expiration_time) override;
47 virtual void OnGetTokenFailure( 47 virtual void OnGetTokenFailure(
48 const OAuth2TokenService::Request* request, 48 const OAuth2TokenService::Request* request,
49 const GoogleServiceAuthError& error) override; 49 const GoogleServiceAuthError& error) override;
50 50
51 OAuth2TokenService::Request* GetTokenRequestForTesting() { 51 OAuth2TokenService::Request* GetTokenRequestForTesting() {
52 return token_request_.get(); 52 return token_request_.get();
53 } 53 }
54 54
55 private: 55 private:
56 void Start();
57
58 // Continues the enrollment process after the owner ID is stored into the boot 56 // Continues the enrollment process after the owner ID is stored into the boot
59 // lockbox and the owner signs in. 57 // lockbox and the owner signs in.
60 void ContinueEnrollmentProcess(); 58 void ContinueEnrollmentProcess();
61 59
62 // Called when the owner's refresh token is available. 60 // Called when the owner's refresh token is available.
63 void OnOwnerRefreshTokenAvailable(); 61 void OnOwnerRefreshTokenAvailable();
64 62
65 // Called when the owner's access token for device management is available. 63 // Called when the owner's access token for device management is available.
66 void OnOwnerAccessTokenAvailable(const std::string& access_token); 64 void OnOwnerAccessTokenAvailable(const std::string& access_token);
67 65
68 // Called upon the completion of the enrollment process. 66 // Called upon the completion of the enrollment process.
69 void OnEnrollmentCompleted(EnrollmentStatus status); 67 void OnEnrollmentCompleted(EnrollmentStatus status);
70 68
71 // Ends the enrollment process and shows a desktop notification if the 69 // Ends the enrollment process.
72 // current user is the owner.
73 void EndEnrollment(ConsumerManagementService::EnrollmentStage stage); 70 void EndEnrollment(ConsumerManagementService::EnrollmentStage stage);
74 71
75 // Shows a desktop notification and resets the enrollment stage.
76 void ShowDesktopNotificationAndResetStage(
77 ConsumerManagementService::EnrollmentStage stage);
78
79 // Opens the settings page.
80 void OpenSettingsPage() const;
81
82 // Opens the enrollment confirmation dialog in the settings page.
83 void TryEnrollmentAgain() const;
84
85 Profile* profile_; 72 Profile* profile_;
86 ConsumerManagementService* consumer_management_service_; 73 ConsumerManagementService* consumer_management_service_;
87 DeviceManagementService* device_management_service_; 74 DeviceManagementService* device_management_service_;
88 std::string gaia_account_id_; 75 std::string gaia_account_id_;
89 76
90 scoped_ptr<OAuth2TokenService::Request> token_request_; 77 scoped_ptr<OAuth2TokenService::Request> token_request_;
91 base::WeakPtrFactory<ConsumerEnrollmentHandler> weak_ptr_factory_; 78 base::WeakPtrFactory<ConsumerEnrollmentHandler> weak_ptr_factory_;
92 79
93 DISALLOW_COPY_AND_ASSIGN(ConsumerEnrollmentHandler); 80 DISALLOW_COPY_AND_ASSIGN(ConsumerEnrollmentHandler);
94 }; 81 };
95 82
96 } // namespace policy 83 } // namespace policy
97 84
98 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_ENROLLMENT_HANDLER_H_ 85 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_ENROLLMENT_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698