Ignore title parameter for navigator.registerProtocolHandler
[chromium-blink-merge.git] / components / policy / core / common / policy_provider_android.cc
blobd70fbe6904bdb6194646117cb348c6b181788495
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.
5 #include "components/policy/core/common/policy_provider_android.h"
6 #include "components/policy/core/common/policy_provider_android_delegate.h"
8 namespace policy {
10 namespace {
12 bool g_wait_for_policies = false;
14 } // namespace
16 PolicyProviderAndroid::PolicyProviderAndroid()
17 : delegate_(NULL),
18 initialized_(!g_wait_for_policies) {}
20 PolicyProviderAndroid::~PolicyProviderAndroid() {}
22 // static
23 void PolicyProviderAndroid::SetShouldWaitForPolicy(
24 bool should_wait_for_policy) {
25 g_wait_for_policies = should_wait_for_policy;
28 void PolicyProviderAndroid::SetDelegate(
29 PolicyProviderAndroidDelegate* delegate) {
30 delegate_ = delegate;
33 void PolicyProviderAndroid::SetPolicies(scoped_ptr<PolicyBundle> policy) {
34 initialized_ = true;
35 UpdatePolicy(policy.Pass());
38 void PolicyProviderAndroid::Shutdown() {
39 if (delegate_)
40 delegate_->PolicyProviderShutdown();
42 ConfigurationPolicyProvider::Shutdown();
45 bool PolicyProviderAndroid::IsInitializationComplete(
46 PolicyDomain domain) const {
47 return initialized_;
50 void PolicyProviderAndroid::RefreshPolicies() {
51 if (delegate_) {
52 delegate_->RefreshPolicies();
53 } else {
54 // If we don't have a delegate, pass a copy of the current policies.
55 scoped_ptr<PolicyBundle> bundle(new PolicyBundle());
56 bundle->CopyFrom(policies());
57 UpdatePolicy(bundle.Pass());
61 } // namespace policy