| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 SendChangesToSyncableService(change_list, GetSyncableService()); | 132 SendChangesToSyncableService(change_list, GetSyncableService()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 #if defined(ENABLE_CONFIGURATION_POLICY) | 135 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 136 void SetPolicies(const base::DictionaryValue& policies) { | 136 void SetPolicies(const base::DictionaryValue& policies) { |
| 137 scoped_ptr<policy::PolicyBundle> bundle(new policy::PolicyBundle()); | 137 scoped_ptr<policy::PolicyBundle> bundle(new policy::PolicyBundle()); |
| 138 policy::PolicyMap& policy_map = bundle->Get(policy::PolicyNamespace( | 138 policy::PolicyMap& policy_map = bundle->Get(policy::PolicyNamespace( |
| 139 policy::POLICY_DOMAIN_EXTENSIONS, kManagedStorageExtensionId)); | 139 policy::POLICY_DOMAIN_EXTENSIONS, kManagedStorageExtensionId)); |
| 140 policy_map.LoadFrom(&policies, policy::POLICY_LEVEL_MANDATORY, | 140 policy_map.LoadFrom(&policies, policy::POLICY_LEVEL_MANDATORY, |
| 141 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD); | 141 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD); |
| 142 policy_provider_.UpdatePolicy(bundle.Pass()); | 142 policy_provider_.UpdatePolicy(std::move(bundle)); |
| 143 } | 143 } |
| 144 #endif | 144 #endif |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 const Extension* MaybeLoadAndReplyWhenSatisfied( | 147 const Extension* MaybeLoadAndReplyWhenSatisfied( |
| 148 Namespace settings_namespace, | 148 Namespace settings_namespace, |
| 149 const std::string& normal_action, | 149 const std::string& normal_action, |
| 150 const std::string& incognito_action, | 150 const std::string& incognito_action, |
| 151 // May be NULL to imply not loading the extension. | 151 // May be NULL to imply not loading the extension. |
| 152 const std::string* extension_dir, | 152 const std::string* extension_dir, |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 // ENABLE_CONFIGURATION_POLICY is not defined. | 580 // ENABLE_CONFIGURATION_POLICY is not defined. |
| 581 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); | 581 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); |
| 582 frontend->DisableStorageForTesting(MANAGED); | 582 frontend->DisableStorageForTesting(MANAGED); |
| 583 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 583 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
| 584 // Now run the extension. | 584 // Now run the extension. |
| 585 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 585 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
| 586 << message_; | 586 << message_; |
| 587 } | 587 } |
| 588 | 588 |
| 589 } // namespace extensions | 589 } // namespace extensions |
| OLD | NEW |