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 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ |
6 #define CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ | 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // |BuildServiceInstanceFor()|. | 69 // |BuildServiceInstanceFor()|. |
70 void NotifyObserversOfSigninManagerCreationForTesting( | 70 void NotifyObserversOfSigninManagerCreationForTesting( |
71 SigninManagerBase* manager); | 71 SigninManagerBase* manager); |
72 | 72 |
73 private: | 73 private: |
74 friend struct DefaultSingletonTraits<SigninManagerFactory>; | 74 friend struct DefaultSingletonTraits<SigninManagerFactory>; |
75 | 75 |
76 SigninManagerFactory(); | 76 SigninManagerFactory(); |
77 virtual ~SigninManagerFactory(); | 77 virtual ~SigninManagerFactory(); |
78 | 78 |
79 #if defined(OS_MACOSX) | |
80 // List of observers. Does not check that list is empty on destruction, as | |
81 // there are some leaky singletons that observe the SigninManagerFactory. | |
82 mutable ObserverList<Observer> observer_list_; | |
83 #else | |
84 // List of observers. Checks that list is empty on destruction. | 79 // List of observers. Checks that list is empty on destruction. |
85 mutable ObserverList<Observer, true> observer_list_; | 80 mutable ObserverList<Observer, true> observer_list_; |
86 #endif | |
87 | 81 |
88 // BrowserContextKeyedServiceFactory: | 82 // BrowserContextKeyedServiceFactory: |
89 virtual KeyedService* BuildServiceInstanceFor( | 83 virtual KeyedService* BuildServiceInstanceFor( |
90 content::BrowserContext* profile) const OVERRIDE; | 84 content::BrowserContext* profile) const OVERRIDE; |
91 virtual void BrowserContextShutdown(content::BrowserContext* context) | 85 virtual void BrowserContextShutdown(content::BrowserContext* context) |
92 OVERRIDE; | 86 OVERRIDE; |
93 }; | 87 }; |
94 | 88 |
95 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ | 89 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ |
OLD | NEW |