Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Side by Side Diff: chrome/browser/chromeos/ownership/owner_settings_service_factory.h

Issue 516243002: Instantiation of OwnerKeyUtil is delegated to OwnerSettingsServiceFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed empty ownership_test_support target. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h"
12 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
13 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 14 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
14 15
15 class KeyedService; 16 class KeyedService;
16 class Profile; 17 class Profile;
17 18
19 namespace ownership {
20 class OwnerKeyUtil;
21 }
22
18 namespace chromeos { 23 namespace chromeos {
19 24
20 class OwnerSettingsService; 25 class OwnerSettingsService;
21 26
22 class OwnerSettingsServiceFactory : public BrowserContextKeyedServiceFactory { 27 class OwnerSettingsServiceFactory : public BrowserContextKeyedServiceFactory {
23 public: 28 public:
24 static OwnerSettingsService* GetForProfile(Profile* profile); 29 static OwnerSettingsService* GetForProfile(Profile* profile);
25 30
26 static OwnerSettingsServiceFactory* GetInstance(); 31 static OwnerSettingsServiceFactory* GetInstance();
27 32
33 scoped_refptr<ownership::OwnerKeyUtil> GetOwnerKeyUtil();
34
35 void SetOwnerKeyUtilForTesting(
36 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util);
37
28 private: 38 private:
29 friend struct DefaultSingletonTraits<OwnerSettingsServiceFactory>; 39 friend struct DefaultSingletonTraits<OwnerSettingsServiceFactory>;
30 40
31 OwnerSettingsServiceFactory(); 41 OwnerSettingsServiceFactory();
32 virtual ~OwnerSettingsServiceFactory(); 42 virtual ~OwnerSettingsServiceFactory();
33 43
34 static KeyedService* BuildInstanceFor(content::BrowserContext* context); 44 static KeyedService* BuildInstanceFor(content::BrowserContext* context);
35 45
36 // BrowserContextKeyedBaseFactory overrides: 46 // BrowserContextKeyedBaseFactory overrides:
37 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; 47 virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE;
38 48
39 // BrowserContextKeyedServiceFactory implementation: 49 // BrowserContextKeyedServiceFactory implementation:
40 virtual KeyedService* BuildServiceInstanceFor( 50 virtual KeyedService* BuildServiceInstanceFor(
41 content::BrowserContext* browser_context) const OVERRIDE; 51 content::BrowserContext* browser_context) const OVERRIDE;
42 52
53 scoped_refptr<ownership::OwnerKeyUtil> owner_key_util_;
54
43 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceFactory); 55 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceFactory);
44 }; 56 };
45 57
46 } // namespace chromeos 58 } // namespace chromeos
47 59
48 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_ 60 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698