| 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 "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 5 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
| 10 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" | 10 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 ManagerMap::const_iterator it = managers_.find(profile); | 60 ManagerMap::const_iterator it = managers_.find(profile); |
| 61 return it != managers_.end() ? it->second : NULL; | 61 return it != managers_.end() ? it->second : NULL; |
| 62 } | 62 } |
| 63 | 63 |
| 64 scoped_ptr<UserCloudPolicyManager> | 64 scoped_ptr<UserCloudPolicyManager> |
| 65 UserCloudPolicyManagerFactory::CreateManagerForOriginalProfile( | 65 UserCloudPolicyManagerFactory::CreateManagerForOriginalProfile( |
| 66 Profile* profile, | 66 Profile* profile, |
| 67 bool force_immediate_load, | 67 bool force_immediate_load, |
| 68 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { | 68 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { |
| 69 scoped_ptr<UserCloudPolicyStore> store( | 69 scoped_ptr<UserCloudPolicyStore> store( |
| 70 UserCloudPolicyStore::Create(profile, background_task_runner)); | 70 UserCloudPolicyStore::Create(profile->GetPath(), background_task_runner)); |
| 71 if (force_immediate_load) | 71 if (force_immediate_load) |
| 72 store->LoadImmediately(); | 72 store->LoadImmediately(); |
| 73 scoped_ptr<UserCloudPolicyManager> manager( | 73 scoped_ptr<UserCloudPolicyManager> manager( |
| 74 new UserCloudPolicyManager(profile, | 74 new UserCloudPolicyManager(profile, |
| 75 store.Pass(), | 75 store.Pass(), |
| 76 scoped_ptr<CloudExternalDataManager>(), | 76 scoped_ptr<CloudExternalDataManager>(), |
| 77 base::MessageLoopProxy::current())); | 77 base::MessageLoopProxy::current())); |
| 78 manager->Init(); | 78 manager->Init(); |
| 79 return manager.Pass(); | 79 return manager.Pass(); |
| 80 } | 80 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 ManagerMap::iterator entry = managers_.find(profile); | 121 ManagerMap::iterator entry = managers_.find(profile); |
| 122 if (entry != managers_.end()) { | 122 if (entry != managers_.end()) { |
| 123 DCHECK_EQ(instance, entry->second); | 123 DCHECK_EQ(instance, entry->second); |
| 124 managers_.erase(entry); | 124 managers_.erase(entry); |
| 125 } else { | 125 } else { |
| 126 NOTREACHED(); | 126 NOTREACHED(); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace policy | 130 } // namespace policy |
| OLD | NEW |