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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "chrome/browser/extensions/api/storage/settings_frontend.h" | 7 #include "chrome/browser/extensions/api/storage/settings_frontend.h" |
8 #include "chrome/browser/extensions/api/storage/settings_namespace.h" | 8 #include "chrome/browser/extensions/api/storage/settings_namespace.h" |
9 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" | 9 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 void FinalReplyWhenSatisfied( | 122 void FinalReplyWhenSatisfied( |
123 Namespace settings_namespace, | 123 Namespace settings_namespace, |
124 const std::string& normal_action, | 124 const std::string& normal_action, |
125 const std::string& incognito_action) { | 125 const std::string& incognito_action) { |
126 MaybeLoadAndReplyWhenSatisfied( | 126 MaybeLoadAndReplyWhenSatisfied( |
127 settings_namespace, normal_action, incognito_action, NULL, true); | 127 settings_namespace, normal_action, incognito_action, NULL, true); |
128 } | 128 } |
129 | 129 |
130 void InitSync(syncer::SyncChangeProcessor* sync_processor) { | 130 void InitSync(syncer::SyncChangeProcessor* sync_processor) { |
131 MessageLoop::current()->RunUntilIdle(); | 131 base::MessageLoop::current()->RunUntilIdle(); |
132 InitSyncWithSyncableService( | 132 InitSyncWithSyncableService( |
133 sync_processor, | 133 sync_processor, |
134 browser()->profile()->GetExtensionService()->settings_frontend()-> | 134 browser()->profile()->GetExtensionService()->settings_frontend()-> |
135 GetBackendForSync(kModelType)); | 135 GetBackendForSync(kModelType)); |
136 } | 136 } |
137 | 137 |
138 void SendChanges(const syncer::SyncChangeList& change_list) { | 138 void SendChanges(const syncer::SyncChangeList& change_list) { |
139 MessageLoop::current()->RunUntilIdle(); | 139 base::MessageLoop::current()->RunUntilIdle(); |
140 SendChangesToSyncableService( | 140 SendChangesToSyncableService( |
141 change_list, | 141 change_list, |
142 browser()->profile()->GetExtensionService()->settings_frontend()-> | 142 browser()->profile()->GetExtensionService()->settings_frontend()-> |
143 GetBackendForSync(kModelType)); | 143 GetBackendForSync(kModelType)); |
144 } | 144 } |
145 | 145 |
146 #if defined(ENABLE_CONFIGURATION_POLICY) | 146 #if defined(ENABLE_CONFIGURATION_POLICY) |
147 void SetPolicies(const base::DictionaryValue& policies) { | 147 void SetPolicies(const base::DictionaryValue& policies) { |
148 scoped_ptr<policy::PolicyBundle> bundle(new policy::PolicyBundle()); | 148 scoped_ptr<policy::PolicyBundle> bundle(new policy::PolicyBundle()); |
149 policy::PolicyMap& policy_map = bundle->Get(policy::PolicyNamespace( | 149 policy::PolicyMap& policy_map = bundle->Get(policy::PolicyNamespace( |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 SettingsFrontend* frontend = | 516 SettingsFrontend* frontend = |
517 browser()->profile()->GetExtensionService()->settings_frontend(); | 517 browser()->profile()->GetExtensionService()->settings_frontend(); |
518 frontend->DisableStorageForTesting(MANAGED); | 518 frontend->DisableStorageForTesting(MANAGED); |
519 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 519 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
520 // Now run the extension. | 520 // Now run the extension. |
521 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 521 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
522 << message_; | 522 << message_; |
523 } | 523 } |
524 | 524 |
525 } // namespace extensions | 525 } // namespace extensions |
OLD | NEW |