OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/arc/arc_policy_bridge.h" | 5 #include "chrome/browser/chromeos/arc/arc_policy_bridge.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 arc_bridge_service()->RemoveObserver(this); | 128 arc_bridge_service()->RemoveObserver(this); |
129 } | 129 } |
130 | 130 |
131 void ArcPolicyBridge::OnPolicyInstanceReady() { | 131 void ArcPolicyBridge::OnPolicyInstanceReady() { |
132 VLOG(1) << "ArcPolicyBridge::OnPolicyInstanceReady"; | 132 VLOG(1) << "ArcPolicyBridge::OnPolicyInstanceReady"; |
133 if (policy_service_ == nullptr) { | 133 if (policy_service_ == nullptr) { |
134 InitializePolicyService(); | 134 InitializePolicyService(); |
135 } | 135 } |
136 policy_service_->AddObserver(policy::POLICY_DOMAIN_CHROME, this); | 136 policy_service_->AddObserver(policy::POLICY_DOMAIN_CHROME, this); |
137 | 137 |
138 PolicyInstance* const policy_instance = | 138 mojom::PolicyInstance* const policy_instance = |
139 arc_bridge_service()->policy_instance(); | 139 arc_bridge_service()->policy_instance(); |
140 if (!policy_instance) { | 140 if (!policy_instance) { |
141 LOG(ERROR) << "OnPolicyInstanceReady called, but no policy instance found"; | 141 LOG(ERROR) << "OnPolicyInstanceReady called, but no policy instance found"; |
142 return; | 142 return; |
143 } | 143 } |
144 | 144 |
145 policy_instance->Init(binding_.CreateInterfacePtrAndBind()); | 145 policy_instance->Init(binding_.CreateInterfacePtrAndBind()); |
146 } | 146 } |
147 | 147 |
148 void ArcPolicyBridge::OnPolicyInstanceClosed() { | 148 void ArcPolicyBridge::OnPolicyInstanceClosed() { |
(...skipping 24 matching lines...) Expand all Loading... |
173 const user_manager::User* const primary_user = | 173 const user_manager::User* const primary_user = |
174 user_manager::UserManager::Get()->GetPrimaryUser(); | 174 user_manager::UserManager::Get()->GetPrimaryUser(); |
175 Profile* const profile = | 175 Profile* const profile = |
176 chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); | 176 chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); |
177 policy_service_ = | 177 policy_service_ = |
178 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile) | 178 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile) |
179 ->policy_service(); | 179 ->policy_service(); |
180 } | 180 } |
181 | 181 |
182 } // namespace arc | 182 } // namespace arc |
OLD | NEW |