| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/policy/cloud/policy_header_service_factory.h" | 5 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 class PolicyHeaderServiceWrapper : public KeyedService { | 31 class PolicyHeaderServiceWrapper : public KeyedService { |
| 32 public: | 32 public: |
| 33 explicit PolicyHeaderServiceWrapper(scoped_ptr<PolicyHeaderService> service) | 33 explicit PolicyHeaderServiceWrapper(scoped_ptr<PolicyHeaderService> service) |
| 34 : policy_header_service_(service.Pass()) {} | 34 : policy_header_service_(service.Pass()) {} |
| 35 | 35 |
| 36 PolicyHeaderService* policy_header_service() const { | 36 PolicyHeaderService* policy_header_service() const { |
| 37 return policy_header_service_.get(); | 37 return policy_header_service_.get(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual void Shutdown() override { | 40 void Shutdown() override { |
| 41 // Shutdown our core object so it can unregister any observers before the | 41 // Shutdown our core object so it can unregister any observers before the |
| 42 // services we depend on are shutdown. | 42 // services we depend on are shutdown. |
| 43 policy_header_service_.reset(); | 43 policy_header_service_.reset(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 scoped_ptr<PolicyHeaderService> policy_header_service_; | 47 scoped_ptr<PolicyHeaderService> policy_header_service_; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 device_store)); | 110 device_store)); |
| 111 return new PolicyHeaderServiceWrapper(service.Pass()); | 111 return new PolicyHeaderServiceWrapper(service.Pass()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 // static | 114 // static |
| 115 PolicyHeaderServiceFactory* PolicyHeaderServiceFactory::GetInstance() { | 115 PolicyHeaderServiceFactory* PolicyHeaderServiceFactory::GetInstance() { |
| 116 return Singleton<PolicyHeaderServiceFactory>::get(); | 116 return Singleton<PolicyHeaderServiceFactory>::get(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace policy | 119 } // namespace policy |
| OLD | NEW |