OLD | NEW |
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_MANAGEMENT_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/strings/string16.h" |
| 16 #include "chrome/browser/notifications/notification_delegate.h" |
15 #include "chromeos/dbus/dbus_method_call_status.h" | 17 #include "chromeos/dbus/dbus_method_call_status.h" |
16 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
18 #include "google_apis/gaia/oauth2_token_service.h" | 20 #include "google_apis/gaia/oauth2_token_service.h" |
19 | 21 |
20 class PrefRegistrySimple; | 22 class PrefRegistrySimple; |
21 class Profile; | 23 class Profile; |
22 class ProfileOAuth2TokenService; | |
23 | 24 |
24 namespace chromeos { | 25 namespace chromeos { |
25 class CryptohomeClient; | 26 class CryptohomeClient; |
26 } | 27 } |
27 | 28 |
28 namespace cryptohome { | 29 namespace cryptohome { |
29 class BaseReply; | 30 class BaseReply; |
30 } | 31 } |
31 | 32 |
32 namespace policy { | 33 namespace policy { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 void OnOwnerAccessTokenAvailable(const std::string& access_token); | 149 void OnOwnerAccessTokenAvailable(const std::string& access_token); |
149 | 150 |
150 // Called upon the completion of the enrollment process. | 151 // Called upon the completion of the enrollment process. |
151 void OnEnrollmentCompleted(EnrollmentStatus status); | 152 void OnEnrollmentCompleted(EnrollmentStatus status); |
152 | 153 |
153 // Ends the enrollment process and shows a desktop notification if the | 154 // Ends the enrollment process and shows a desktop notification if the |
154 // current user is the owner. | 155 // current user is the owner. |
155 void EndEnrollment(ConsumerEnrollmentState state); | 156 void EndEnrollment(ConsumerEnrollmentState state); |
156 | 157 |
157 // Shows a desktop notification and resets the enrollment state. | 158 // Shows a desktop notification and resets the enrollment state. |
158 void ShowDesktopNotificationAndResetState(ConsumerEnrollmentState state); | 159 void ShowDesktopNotificationAndResetState(ConsumerEnrollmentState state, |
| 160 Profile* profile); |
| 161 |
| 162 // Opens the settings page. |
| 163 void OpenSettingsPage(Profile* profile) const; |
| 164 |
| 165 // Opens the enrollment confirmation dialog in the settings page. |
| 166 void TryEnrollmentAgain(Profile* profile) const; |
159 | 167 |
160 chromeos::CryptohomeClient* client_; | 168 chromeos::CryptohomeClient* client_; |
161 | 169 |
162 std::string enrolling_account_id_; | 170 Profile* enrolling_profile_; |
163 ProfileOAuth2TokenService* enrolling_token_service_; | |
164 | |
165 scoped_ptr<OAuth2TokenService::Request> token_request_; | 171 scoped_ptr<OAuth2TokenService::Request> token_request_; |
166 content::NotificationRegistrar registrar_; | 172 content::NotificationRegistrar registrar_; |
167 base::WeakPtrFactory<ConsumerManagementService> weak_ptr_factory_; | 173 base::WeakPtrFactory<ConsumerManagementService> weak_ptr_factory_; |
168 | 174 |
169 DISALLOW_COPY_AND_ASSIGN(ConsumerManagementService); | 175 DISALLOW_COPY_AND_ASSIGN(ConsumerManagementService); |
170 }; | 176 }; |
171 | 177 |
172 } // namespace policy | 178 } // namespace policy |
173 | 179 |
174 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_SERVICE_H_ | 180 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_SERVICE_H_ |
OLD | NEW |