Chromium Code Reviews| 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 #include "chrome/browser/chromeos/policy/device_local_account_extension_tracker. h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_extension_tracker. h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/chromeos/policy/device_local_account.h" | 9 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 10 #include "chrome/browser/extensions/policy_handlers.h" | 10 #include "chrome/browser/extensions/policy_handlers.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, account.kiosk_app_id); | 29 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, account.kiosk_app_id); |
| 30 schema_registry_->RegisterComponent(ns, Schema()); | 30 schema_registry_->RegisterComponent(ns, Schema()); |
| 31 } else if (account.type == DeviceLocalAccount::TYPE_PUBLIC_SESSION) { | 31 } else if (account.type == DeviceLocalAccount::TYPE_PUBLIC_SESSION) { |
| 32 // For public sessions, track the value of the ExtensionInstallForcelist | 32 // For public sessions, track the value of the ExtensionInstallForcelist |
| 33 // policy. | 33 // policy. |
| 34 store_->AddObserver(this); | 34 store_->AddObserver(this); |
| 35 UpdateFromStore(); | 35 UpdateFromStore(); |
| 36 } else { | 36 } else { |
| 37 NOTREACHED(); | 37 NOTREACHED(); |
| 38 } | 38 } |
| 39 | |
| 40 schema_registry_->SetReady(POLICY_DOMAIN_EXTENSIONS); | |
|
emaxx
2016/10/21 03:37:53
It seems that these two lines may be actually safe
| |
| 41 } | 39 } |
| 42 | 40 |
| 43 DeviceLocalAccountExtensionTracker::~DeviceLocalAccountExtensionTracker() { | 41 DeviceLocalAccountExtensionTracker::~DeviceLocalAccountExtensionTracker() { |
| 44 store_->RemoveObserver(this); | 42 store_->RemoveObserver(this); |
| 45 } | 43 } |
| 46 | 44 |
| 47 void DeviceLocalAccountExtensionTracker::OnStoreLoaded( | 45 void DeviceLocalAccountExtensionTracker::OnStoreLoaded( |
| 48 CloudPolicyStore* store) { | 46 CloudPolicyStore* store) { |
| 49 UpdateFromStore(); | 47 UpdateFromStore(); |
| 50 } | 48 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 } | 86 } |
| 89 schema_registry_->RegisterComponent(ns, Schema()); | 87 schema_registry_->RegisterComponent(ns, Schema()); |
| 90 } | 88 } |
| 91 | 89 |
| 92 // Removing an extension from a public session at runtime can happen but is | 90 // Removing an extension from a public session at runtime can happen but is |
| 93 // a rare event. In that case we leave the extension ID in the SchemaRegistry, | 91 // a rare event. In that case we leave the extension ID in the SchemaRegistry, |
| 94 // and it will be purged on the next restart. | 92 // and it will be purged on the next restart. |
| 95 } | 93 } |
| 96 | 94 |
| 97 } // namespace policy | 95 } // namespace policy |
| OLD | NEW |