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

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

Issue 317613004: Remove usage of singleton software_slot_ in nss on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 | Annotate | Revision Log
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_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const AssembleAndSignPolicyCallback& callback) OVERRIDE; 45 const AssembleAndSignPolicyCallback& callback) OVERRIDE;
46 46
47 // NotificationObserver implementation: 47 // NotificationObserver implementation:
48 virtual void Observe(int type, 48 virtual void Observe(int type,
49 const content::NotificationSource& source, 49 const content::NotificationSource& source,
50 const content::NotificationDetails& details) OVERRIDE; 50 const content::NotificationDetails& details) OVERRIDE;
51 51
52 // TPMTokenLoader::Observer: 52 // TPMTokenLoader::Observer:
53 virtual void OnTPMTokenReady() OVERRIDE; 53 virtual void OnTPMTokenReady() OVERRIDE;
54 54
55 // Checks whether NSS slots with private key are mounted or 55 // Checks if the user is the device owner, without the user profile having to
56 // not. Responds via |callback|. 56 // been initialized. Should be used only if login state is in safe mode.
57 static void IsPrivateKeyExistAsync(const IsOwnerCallback& callback); 57 static void IsOwnerForSafeModeAsync(const std::string& user_id,
58 const std::string& user_hash,
59 const IsOwnerCallback& callback);
58 60
59 static void SetOwnerKeyUtilForTesting( 61 static void SetOwnerKeyUtilForTesting(
60 const scoped_refptr<OwnerKeyUtil>& owner_key_util); 62 const scoped_refptr<OwnerKeyUtil>& owner_key_util);
61 63
62 static void SetDeviceSettingsServiceForTesting( 64 static void SetDeviceSettingsServiceForTesting(
63 DeviceSettingsService* device_settings_service); 65 DeviceSettingsService* device_settings_service);
64 66
65 private: 67 private:
66 friend class OwnerSettingsServiceFactory; 68 friend class OwnerSettingsServiceFactory;
67 69
68 explicit OwnerSettingsService(Profile* profile); 70 explicit OwnerSettingsService(Profile* profile);
69 71
72 // Checks whether NSS slots with private key are mounted or
73 // not. Responds via |callback|.
74 static void IsPrivateKeyExistAsync(const IsOwnerCallback& callback);
Ryan Sleevi 2014/07/01 18:51:33 If this is a static method, can't you really just
tbarzic 2014/07/01 23:55:03 no valid reason; moved to .cc
75
70 // Reloads private key from profile's NSS slots. Responds via call 76 // Reloads private key from profile's NSS slots. Responds via call
71 // to OnPrivateKeyLoaded(). 77 // to OnPrivateKeyLoaded().
72 void ReloadPrivateKey(); 78 void ReloadPrivateKey();
73 79
74 // Called when ReloadPrivateKey() completes it's work. 80 // Called when ReloadPrivateKey() completes it's work.
75 void OnPrivateKeyLoaded(scoped_ptr<crypto::RSAPrivateKey> private_key); 81 void OnPrivateKeyLoaded(scoped_ptr<crypto::RSAPrivateKey> private_key);
76 82
77 // Returns testing instance of OwnerKeyUtil when it's set, otherwise 83 // Returns testing instance of OwnerKeyUtil when it's set, otherwise
78 // returns |owner_key_util_|. 84 // returns |owner_key_util_|.
79 scoped_refptr<OwnerKeyUtil> GetOwnerKeyUtil(); 85 scoped_refptr<OwnerKeyUtil> GetOwnerKeyUtil();
(...skipping 23 matching lines...) Expand all
103 base::ThreadChecker thread_checker_; 109 base::ThreadChecker thread_checker_;
104 110
105 base::WeakPtrFactory<OwnerSettingsService> weak_factory_; 111 base::WeakPtrFactory<OwnerSettingsService> weak_factory_;
106 112
107 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService); 113 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService);
108 }; 114 };
109 115
110 } // namespace chromeos 116 } // namespace chromeos
111 117
112 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ 118 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698