OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/chromeos/cros/login_library.h" | 5 #include "chrome/browser/chromeos/cros/login_library.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/timer.h" | 8 #include "base/timer.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
11 #include "chrome/browser/chromeos/login/signed_settings.h" | 11 #include "chrome/browser/chromeos/login/signed_settings.h" |
12 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" | 12 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" |
13 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 13 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
14 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
16 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" |
17 #include "content/common/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
18 | 18 |
19 namespace em = enterprise_management; | 19 namespace em = enterprise_management; |
20 namespace chromeos { | 20 namespace chromeos { |
21 | 21 |
22 LoginLibrary::~LoginLibrary() {} | 22 LoginLibrary::~LoginLibrary() {} |
23 | 23 |
24 class LoginLibraryImpl : public LoginLibrary { | 24 class LoginLibraryImpl : public LoginLibrary { |
25 public: | 25 public: |
26 LoginLibraryImpl() { | 26 LoginLibraryImpl() { |
27 } | 27 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 void CompleteSetOwnerKey(bool value) { | 136 void CompleteSetOwnerKey(bool value) { |
137 VLOG(1) << "Owner key generation: " << (value ? "success" : "fail"); | 137 VLOG(1) << "Owner key generation: " << (value ? "success" : "fail"); |
138 int result = | 138 int result = |
139 chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; | 139 chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; |
140 if (!value) | 140 if (!value) |
141 result = chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED; | 141 result = chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED; |
142 | 142 |
143 // Whether we exported the public key or not, send a notification indicating | 143 // Whether we exported the public key or not, send a notification indicating |
144 // that we're done with this attempt. | 144 // that we're done with this attempt. |
145 NotificationService::current()->Notify(result, | 145 content::NotificationService::current()->Notify( |
146 NotificationService::AllSources(), | 146 result, |
147 NotificationService::NoDetails()); | 147 content::NotificationService::AllSources(), |
| 148 content::NotificationService::NoDetails()); |
148 | 149 |
149 // We stored some settings in transient storage before owner was assigned. | 150 // We stored some settings in transient storage before owner was assigned. |
150 // Now owner is assigned and key is generated and we should persist | 151 // Now owner is assigned and key is generated and we should persist |
151 // those settings into signed storage. | 152 // those settings into signed storage. |
152 if (g_browser_process && g_browser_process->local_state()) { | 153 if (g_browser_process && g_browser_process->local_state()) { |
153 SignedSettingsTempStorage::Finalize(g_browser_process->local_state()); | 154 SignedSettingsTempStorage::Finalize(g_browser_process->local_state()); |
154 } | 155 } |
155 } | 156 } |
156 | 157 |
157 void CompleteWhitelistOp(bool result) { | 158 void CompleteWhitelistOp(bool result) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 LoginLibrary* impl; | 209 LoginLibrary* impl; |
209 if (stub) | 210 if (stub) |
210 impl = new LoginLibraryStubImpl(); | 211 impl = new LoginLibraryStubImpl(); |
211 else | 212 else |
212 impl = new LoginLibraryImpl(); | 213 impl = new LoginLibraryImpl(); |
213 impl->Init(); | 214 impl->Init(); |
214 return impl; | 215 return impl; |
215 } | 216 } |
216 | 217 |
217 } // namespace chromeos | 218 } // namespace chromeos |
OLD | NEW |