Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/policy/core/common/policy_provider_android.h" | |
| 6 #include "components/policy/core/common/policy_provider_android_delegate.h" | |
| 7 | |
| 8 namespace policy { | |
| 9 | |
| 10 namespace { | |
| 11 | |
| 12 bool g_wait_for_policies = false; | |
| 13 | |
| 14 } // namespace | |
| 15 | |
| 16 PolicyProviderAndroid::PolicyProviderAndroid() | |
| 17 : delegate_(NULL), | |
| 18 initialized_(!g_wait_for_policies) {} | |
| 19 PolicyProviderAndroid::~PolicyProviderAndroid() {} | |
|
Joao da Silva
2014/02/05 20:22:26
nit: newline above this one
Bernhard Bauer
2014/02/06 15:00:18
Done.
| |
| 20 | |
| 21 // static | |
| 22 void PolicyProviderAndroid::SetShouldWaitForPolicy( | |
| 23 bool should_wait_for_policy) { | |
| 24 g_wait_for_policies = should_wait_for_policy; | |
| 25 } | |
| 26 | |
| 27 void PolicyProviderAndroid::SetDelegate( | |
| 28 PolicyProviderAndroidDelegate* delegate) { | |
| 29 delegate_ = delegate; | |
| 30 } | |
| 31 | |
| 32 void PolicyProviderAndroid::SetPolicies(scoped_ptr<PolicyBundle> policy) { | |
| 33 initialized_ = true; | |
| 34 UpdatePolicy(policy.Pass()); | |
| 35 } | |
| 36 | |
| 37 void PolicyProviderAndroid::Shutdown() { | |
| 38 if (delegate_) | |
| 39 delegate_->PolicyProviderShutdown(); | |
| 40 | |
| 41 ConfigurationPolicyProvider::Shutdown(); | |
| 42 } | |
| 43 | |
| 44 bool PolicyProviderAndroid::IsInitializationComplete( | |
| 45 PolicyDomain domain) const { | |
| 46 return initialized_; | |
|
Joao da Silva
2014/02/05 20:22:26
Other than the behavior of this flag, this class i
Bernhard Bauer
2014/02/05 22:20:19
Hm, so then downstream I would implement another C
| |
| 47 } | |
| 48 | |
| 49 void PolicyProviderAndroid::RefreshPolicies() { | |
| 50 if (delegate_) | |
| 51 delegate_->RefreshPolicies(); | |
| 52 } | |
|
Joao da Silva
2014/02/05 20:22:26
else {
call UpdatePolicy() with a copy of the cu
Bernhard Bauer
2014/02/05 22:20:19
Oh, good catch! Yeah, I will do that.
Bernhard Bauer
2014/02/06 15:00:18
Done.
| |
| 53 | |
| 54 } // namespace policy | |
| OLD | NEW |