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

Side by Side Diff: chrome/browser/chromeos/ownership/owner_settings_service.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_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 <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 const content::NotificationDetails& details) OVERRIDE; 64 const content::NotificationDetails& details) OVERRIDE;
65 65
66 // TPMTokenLoader::Observer: 66 // TPMTokenLoader::Observer:
67 virtual void OnTPMTokenReady() OVERRIDE; 67 virtual void OnTPMTokenReady() OVERRIDE;
68 68
69 // SessionManagerClient::Observer: 69 // SessionManagerClient::Observer:
70 virtual void OwnerKeySet(bool success) OVERRIDE; 70 virtual void OwnerKeySet(bool success) OVERRIDE;
71 71
72 // Checks if the user is the device owner, without the user profile having to 72 // Checks if the user is the device owner, without the user profile having to
73 // been initialized. Should be used only if login state is in safe mode. 73 // been initialized. Should be used only if login state is in safe mode.
74 static void IsOwnerForSafeModeAsync(const std::string& user_id, 74 static void IsOwnerForSafeModeAsync(
75 const std::string& user_hash, 75 const std::string& user_id,
76 const IsOwnerCallback& callback); 76 const std::string& user_hash,
77 77 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util,
78 static scoped_refptr<ownership::OwnerKeyUtil> MakeOwnerKeyUtil(); 78 const IsOwnerCallback& callback);
79
80 static void SetOwnerKeyUtilForTesting(
81 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util);
82 79
83 static void SetDeviceSettingsServiceForTesting( 80 static void SetDeviceSettingsServiceForTesting(
84 DeviceSettingsService* device_settings_service); 81 DeviceSettingsService* device_settings_service);
85 82
86 private: 83 private:
87 friend class OwnerSettingsServiceFactory; 84 friend class OwnerSettingsServiceFactory;
88 85
89 explicit OwnerSettingsService(Profile* profile); 86 OwnerSettingsService(
87 Profile* profile,
88 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util);
90 89
91 // Reloads private key from profile's NSS slots. Responds via call 90 // Reloads private key from profile's NSS slots. Responds via call
92 // to OnPrivateKeyLoaded(). 91 // to OnPrivateKeyLoaded().
93 void ReloadPrivateKey(); 92 void ReloadPrivateKey();
94 93
95 // Called when ReloadPrivateKey() completes it's work. 94 // Called when ReloadPrivateKey() completes it's work.
96 void OnPrivateKeyLoaded(scoped_refptr<ownership::PublicKey> public_key, 95 void OnPrivateKeyLoaded(scoped_refptr<ownership::PublicKey> public_key,
97 scoped_refptr<ownership::PrivateKey> private_key); 96 scoped_refptr<ownership::PrivateKey> private_key);
98 97
99 // Puts request to perform sign-and-store operation in the queue. 98 // Puts request to perform sign-and-store operation in the queue.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 base::ThreadChecker thread_checker_; 149 base::ThreadChecker thread_checker_;
151 150
152 base::WeakPtrFactory<OwnerSettingsService> weak_factory_; 151 base::WeakPtrFactory<OwnerSettingsService> weak_factory_;
153 152
154 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService); 153 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsService);
155 }; 154 };
156 155
157 } // namespace chromeos 156 } // namespace chromeos
158 157
159 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_ 158 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_OWNER_SETTINGS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698