| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 class PolicyHeaderServiceWrapper : public KeyedService { | 30 class PolicyHeaderServiceWrapper : public KeyedService { |
| 31 public: | 31 public: |
| 32 explicit PolicyHeaderServiceWrapper(scoped_ptr<PolicyHeaderService> service) | 32 explicit PolicyHeaderServiceWrapper(scoped_ptr<PolicyHeaderService> service) |
| 33 : policy_header_service_(service.Pass()) {} | 33 : policy_header_service_(service.Pass()) {} |
| 34 | 34 |
| 35 PolicyHeaderService* policy_header_service() const { | 35 PolicyHeaderService* policy_header_service() const { |
| 36 return policy_header_service_.get(); | 36 return policy_header_service_.get(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 virtual void Shutdown() OVERRIDE { | 39 virtual void Shutdown() override { |
| 40 // Shutdown our core object so it can unregister any observers before the | 40 // Shutdown our core object so it can unregister any observers before the |
| 41 // services we depend on are shutdown. | 41 // services we depend on are shutdown. |
| 42 policy_header_service_.reset(); | 42 policy_header_service_.reset(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 scoped_ptr<PolicyHeaderService> policy_header_service_; | 46 scoped_ptr<PolicyHeaderService> policy_header_service_; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 device_store)); | 109 device_store)); |
| 110 return new PolicyHeaderServiceWrapper(service.Pass()); | 110 return new PolicyHeaderServiceWrapper(service.Pass()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 // static | 113 // static |
| 114 PolicyHeaderServiceFactory* PolicyHeaderServiceFactory::GetInstance() { | 114 PolicyHeaderServiceFactory* PolicyHeaderServiceFactory::GetInstance() { |
| 115 return Singleton<PolicyHeaderServiceFactory>::get(); | 115 return Singleton<PolicyHeaderServiceFactory>::get(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace policy | 118 } // namespace policy |
| OLD | NEW |