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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 arc_bridge_service()->RemoveObserver(this); | 130 arc_bridge_service()->RemoveObserver(this); |
131 } | 131 } |
132 | 132 |
133 void ArcPolicyBridge::OnPolicyInstanceReady() { | 133 void ArcPolicyBridge::OnPolicyInstanceReady() { |
134 VLOG(1) << "ArcPolicyBridge::OnPolicyInstanceReady"; | 134 VLOG(1) << "ArcPolicyBridge::OnPolicyInstanceReady"; |
135 if (policy_service_ == nullptr) { | 135 if (policy_service_ == nullptr) { |
136 InitializePolicyService(); | 136 InitializePolicyService(); |
137 } | 137 } |
138 policy_service_->AddObserver(policy::POLICY_DOMAIN_CHROME, this); | 138 policy_service_->AddObserver(policy::POLICY_DOMAIN_CHROME, this); |
139 | 139 |
140 PolicyInstance* const policy_instance = | 140 mojom::PolicyInstance* const policy_instance = |
141 arc_bridge_service()->policy_instance(); | 141 arc_bridge_service()->policy_instance(); |
142 if (!policy_instance) { | 142 if (!policy_instance) { |
143 LOG(ERROR) << "OnPolicyInstanceReady called, but no policy instance found"; | 143 LOG(ERROR) << "OnPolicyInstanceReady called, but no policy instance found"; |
144 return; | 144 return; |
145 } | 145 } |
146 | 146 |
147 policy_instance->Init(binding_.CreateInterfacePtrAndBind()); | 147 policy_instance->Init(binding_.CreateInterfacePtrAndBind()); |
148 } | 148 } |
149 | 149 |
150 void ArcPolicyBridge::OnPolicyInstanceClosed() { | 150 void ArcPolicyBridge::OnPolicyInstanceClosed() { |
(...skipping 24 matching lines...) Expand all Loading... |
175 const user_manager::User* const primary_user = | 175 const user_manager::User* const primary_user = |
176 user_manager::UserManager::Get()->GetPrimaryUser(); | 176 user_manager::UserManager::Get()->GetPrimaryUser(); |
177 Profile* const profile = | 177 Profile* const profile = |
178 chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); | 178 chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); |
179 policy_service_ = | 179 policy_service_ = |
180 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile) | 180 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile) |
181 ->policy_service(); | 181 ->policy_service(); |
182 } | 182 } |
183 | 183 |
184 } // namespace arc | 184 } // namespace arc |
OLD | NEW |