#include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
TPMTokenLoader::Get()->AddObserver(this);
}
+ if (DBusThreadManager::IsInitialized() &&
+ DBusThreadManager::Get()->GetSessionManagerClient()) {
+ DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this);
+ }
+
registrar_.Add(this,
chrome::NOTIFICATION_PROFILE_CREATED,
content::Source<Profile>(profile_));
DCHECK(thread_checker_.CalledOnValidThread());
if (TPMTokenLoader::IsInitialized())
TPMTokenLoader::Get()->RemoveObserver(this);
+
+ if (DBusThreadManager::IsInitialized() &&
+ DBusThreadManager::Get()->GetSessionManagerClient()) {
+ DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this);
+ }
}
bool OwnerSettingsService::IsOwner() {
ReloadPrivateKey();
}
+void OwnerSettingsService::OwnerKeySet(bool success) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ if (success)
+ ReloadPrivateKey();
+}
+
// static
void OwnerSettingsService::IsPrivateKeyExistAsync(
const IsOwnerCallback& callback) {
std::vector<IsOwnerCallback> is_owner_callbacks;
is_owner_callbacks.swap(pending_is_owner_callbacks_);
- const bool is_owner = private_key_.get() && private_key_->key();
+ const bool is_owner = IsOwner();
for (std::vector<IsOwnerCallback>::iterator it(is_owner_callbacks.begin());
it != is_owner_callbacks.end();
++it) {