Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/policy/user_cloud_policy_manager_factory_chrom eos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom eos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | |
| 7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
| 12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 13 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
| 14 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
| 15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 16 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 27 #include "chrome/browser/policy/schema_registry_service.h" | 28 #include "chrome/browser/policy/schema_registry_service.h" |
| 28 #include "chrome/browser/policy/schema_registry_service_factory.h" | 29 #include "chrome/browser/policy/schema_registry_service_factory.h" |
| 29 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 31 #include "chromeos/chromeos_paths.h" | 32 #include "chromeos/chromeos_paths.h" |
| 32 #include "chromeos/chromeos_switches.h" | 33 #include "chromeos/chromeos_switches.h" |
| 33 #include "chromeos/dbus/dbus_thread_manager.h" | 34 #include "chromeos/dbus/dbus_thread_manager.h" |
| 34 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" | 35 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" |
| 35 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
| 36 #include "net/url_request/url_request_context_getter.h" | 37 #include "net/url_request/url_request_context_getter.h" |
| 37 #include "policy/policy_constants.h" | 38 #include "policy/policy_constants.h" |
|
bartfab (slow)
2013/11/05 18:18:33
Nit: policy/policy_constants.h now implicitly pull
Joao da Silva
2013/11/07 20:27:27
See previous reply
| |
| 38 | 39 |
| 39 namespace policy { | 40 namespace policy { |
| 40 | 41 |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 // Subdirectory in the user's profile for storing legacy user policies. | 44 // Subdirectory in the user's profile for storing legacy user policies. |
| 44 const base::FilePath::CharType kDeviceManagementDir[] = | 45 const base::FilePath::CharType kDeviceManagementDir[] = |
| 45 FILE_PATH_LITERAL("Device Management"); | 46 FILE_PATH_LITERAL("Device Management"); |
| 46 // File in the above directory for storing legacy user policy dmtokens. | 47 // File in the above directory for storing legacy user policy dmtokens. |
| 47 const base::FilePath::CharType kToken[] = FILE_PATH_LITERAL("Token"); | 48 const base::FilePath::CharType kToken[] = FILE_PATH_LITERAL("Token"); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 background_task_runner, | 167 background_task_runner, |
| 167 username, policy_key_dir, token_cache_file, policy_cache_file)); | 168 username, policy_key_dir, token_cache_file, policy_cache_file)); |
| 168 | 169 |
| 169 scoped_refptr<base::SequencedTaskRunner> backend_task_runner = | 170 scoped_refptr<base::SequencedTaskRunner> backend_task_runner = |
| 170 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 171 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( |
| 171 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); | 172 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); |
| 172 scoped_refptr<base::SequencedTaskRunner> io_task_runner = | 173 scoped_refptr<base::SequencedTaskRunner> io_task_runner = |
| 173 content::BrowserThread::GetMessageLoopProxyForThread( | 174 content::BrowserThread::GetMessageLoopProxyForThread( |
| 174 content::BrowserThread::IO); | 175 content::BrowserThread::IO); |
| 175 scoped_ptr<CloudExternalDataManager> external_data_manager( | 176 scoped_ptr<CloudExternalDataManager> external_data_manager( |
| 176 new UserCloudExternalDataManager(GetChromePolicyDefinitionList(), | 177 new UserCloudExternalDataManager(base::Bind(&GetChromePolicyDetails), |
| 177 backend_task_runner, | 178 backend_task_runner, |
| 178 io_task_runner, | 179 io_task_runner, |
| 179 external_data_dir, | 180 external_data_dir, |
| 180 store.get())); | 181 store.get())); |
| 181 if (force_immediate_load) | 182 if (force_immediate_load) |
| 182 store->LoadImmediately(); | 183 store->LoadImmediately(); |
| 183 | 184 |
| 184 scoped_ptr<ResourceCache> resource_cache; | 185 scoped_ptr<ResourceCache> resource_cache; |
| 185 if (command_line->HasSwitch(switches::kEnableComponentCloudPolicy)) { | 186 if (command_line->HasSwitch(switches::kEnableComponentCloudPolicy)) { |
| 186 resource_cache.reset(new ResourceCache( | 187 resource_cache.reset(new ResourceCache( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); | 226 BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); |
| 226 } | 227 } |
| 227 | 228 |
| 228 void UserCloudPolicyManagerFactoryChromeOS::SetEmptyTestingFactory( | 229 void UserCloudPolicyManagerFactoryChromeOS::SetEmptyTestingFactory( |
| 229 content::BrowserContext* context) {} | 230 content::BrowserContext* context) {} |
| 230 | 231 |
| 231 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( | 232 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( |
| 232 content::BrowserContext* context) {} | 233 content::BrowserContext* context) {} |
| 233 | 234 |
| 234 } // namespace policy | 235 } // namespace policy |
| OLD | NEW |