| 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/login/session_manager_observer.h" | 5 #include "chrome/browser/chromeos/login/session_manager_observer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/chromeos/login/signed_settings.h" | 8 #include "chrome/browser/chromeos/login/signed_settings.h" |
| 9 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" | 9 #include "chrome/browser/chromeos/login/signed_settings_cache.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 class StubDelegate | 18 class StubDelegate |
| 19 : public SignedSettings::Delegate< | 19 : public SignedSettings::Delegate< |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; | 52 chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED; |
| 53 if (!success) | 53 if (!success) |
| 54 result = chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED; | 54 result = chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_FAILED; |
| 55 | 55 |
| 56 // Whether we exported the public key or not, send a notification | 56 // Whether we exported the public key or not, send a notification |
| 57 // indicating that we're done with this attempt. | 57 // indicating that we're done with this attempt. |
| 58 content::NotificationService::current()->Notify( | 58 content::NotificationService::current()->Notify( |
| 59 result, | 59 result, |
| 60 content::NotificationService::AllSources(), | 60 content::NotificationService::AllSources(), |
| 61 content::NotificationService::NoDetails()); | 61 content::NotificationService::NoDetails()); |
| 62 | |
| 63 // We stored some settings in transient storage before owner was assigned. | |
| 64 // Now owner is assigned and key is generated and we should persist | |
| 65 // those settings into signed storage. | |
| 66 if (g_browser_process && g_browser_process->local_state()) { | |
| 67 SignedSettingsTempStorage::Finalize(g_browser_process->local_state()); | |
| 68 } | |
| 69 } | 62 } |
| 70 | 63 |
| 71 void SessionManagerObserver::PropertyChangeComplete(bool success) { | 64 void SessionManagerObserver::PropertyChangeComplete(bool success) { |
| 72 if (success) { | 65 if (success) { |
| 73 StubDelegate* stub = new StubDelegate(); // Manages its own lifetime. | 66 StubDelegate* stub = new StubDelegate(); // Manages its own lifetime. |
| 74 stub->set_fetcher(SignedSettings::CreateRetrievePolicyOp(stub)); | 67 stub->set_fetcher(SignedSettings::CreateRetrievePolicyOp(stub)); |
| 75 stub->fetcher()->Execute(); | 68 stub->fetcher()->Execute(); |
| 76 } | 69 } |
| 77 } | 70 } |
| 78 | 71 |
| 79 } // namespace chromeos | 72 } // namespace chromeos |
| OLD | NEW |