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 24 matching lines...) Expand all Loading... |
35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
36 // Returns the instance of SigninManager associated with this profile | 36 // Returns the instance of SigninManager associated with this profile |
37 // (creating one if none exists). Returns NULL if this profile cannot have a | 37 // (creating one if none exists). Returns NULL if this profile cannot have a |
38 // SigninManager (for example, if |profile| is incognito). | 38 // SigninManager (for example, if |profile| is incognito). |
39 static SigninManagerBase* GetForProfile(Profile* profile); | 39 static SigninManagerBase* GetForProfile(Profile* profile); |
40 | 40 |
41 // Returns the instance of SigninManager associated with this profile. Returns | 41 // Returns the instance of SigninManager associated with this profile. Returns |
42 // null if no SigninManager instance currently exists (will not create a new | 42 // null if no SigninManager instance currently exists (will not create a new |
43 // instance). | 43 // instance). |
44 static SigninManagerBase* GetForProfileIfExists(Profile* profile); | 44 static SigninManagerBase* GetForProfileIfExists(Profile* profile); |
| 45 static const SigninManagerBase* GetForProfileIfExists(const Profile* profile); |
45 #else | 46 #else |
46 // On non-ChromeOS platforms, the SigninManager the factory creates will be | 47 // On non-ChromeOS platforms, the SigninManager the factory creates will be |
47 // an instance of the extended SigninManager class. | 48 // an instance of the extended SigninManager class. |
48 static SigninManager* GetForProfile(Profile* profile); | 49 static SigninManager* GetForProfile(Profile* profile); |
49 static SigninManager* GetForProfileIfExists(Profile* profile); | 50 static SigninManager* GetForProfileIfExists(Profile* profile); |
| 51 static const SigninManager* GetForProfileIfExists(const Profile* profile); |
50 #endif | 52 #endif |
51 | 53 |
52 // Returns an instance of the SigninManagerFactory singleton. | 54 // Returns an instance of the SigninManagerFactory singleton. |
53 static SigninManagerFactory* GetInstance(); | 55 static SigninManagerFactory* GetInstance(); |
54 | 56 |
55 // Implementation of BrowserContextKeyedServiceFactory (public so tests | 57 // Implementation of BrowserContextKeyedServiceFactory (public so tests |
56 // can call it). | 58 // can call it). |
57 void RegisterProfilePrefs( | 59 void RegisterProfilePrefs( |
58 user_prefs::PrefRegistrySyncable* registry) override; | 60 user_prefs::PrefRegistrySyncable* registry) override; |
59 | 61 |
(...skipping 19 matching lines...) Expand all Loading... |
79 // List of observers. Checks that list is empty on destruction. | 81 // List of observers. Checks that list is empty on destruction. |
80 mutable ObserverList<Observer, true> observer_list_; | 82 mutable ObserverList<Observer, true> observer_list_; |
81 | 83 |
82 // BrowserContextKeyedServiceFactory: | 84 // BrowserContextKeyedServiceFactory: |
83 KeyedService* BuildServiceInstanceFor( | 85 KeyedService* BuildServiceInstanceFor( |
84 content::BrowserContext* profile) const override; | 86 content::BrowserContext* profile) const override; |
85 void BrowserContextShutdown(content::BrowserContext* context) override; | 87 void BrowserContextShutdown(content::BrowserContext* context) override; |
86 }; | 88 }; |
87 | 89 |
88 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ | 90 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ |
OLD | NEW |