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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_policy_store.h

Issue 2801993002: Abandon user sign in when policy is retrieved before session started (Closed)
Patch Set: Nits Created 3 years, 8 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 (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_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "chrome/browser/chromeos/settings/device_settings_service.h" 16 #include "chrome/browser/chromeos/settings/device_settings_service.h"
17 #include "chromeos/dbus/session_manager_client.h"
17 #include "components/policy/core/common/cloud/cloud_policy_validator.h" 18 #include "components/policy/core/common/cloud/cloud_policy_validator.h"
18 #include "components/policy/core/common/cloud/user_cloud_policy_store_base.h" 19 #include "components/policy/core/common/cloud/user_cloud_policy_store_base.h"
19 20
20 namespace base { 21 namespace base {
21 class SequencedTaskRunner; 22 class SequencedTaskRunner;
22 } 23 }
23 24
24 namespace chromeos {
25 class SessionManagerClient;
26 }
27
28 namespace enterprise_management { 25 namespace enterprise_management {
29 class PolicyFetchResponse; 26 class PolicyFetchResponse;
30 } 27 }
31 28
32 namespace policy { 29 namespace policy {
33 30
34 // CloudPolicyStore implementation for device-local account policy. Stores/loads 31 // CloudPolicyStore implementation for device-local account policy. Stores/loads
35 // policy to/from session_manager. 32 // policy to/from session_manager.
36 class DeviceLocalAccountPolicyStore : public UserCloudPolicyStoreBase { 33 class DeviceLocalAccountPolicyStore : public UserCloudPolicyStoreBase {
37 public: 34 public:
(...skipping 14 matching lines...) Expand all
52 void LoadImmediately(); 49 void LoadImmediately();
53 50
54 private: 51 private:
55 // The callback invoked once policy validation is complete. Passed are the 52 // The callback invoked once policy validation is complete. Passed are the
56 // used public key and the validator. 53 // used public key and the validator.
57 using ValidateCompletionCallback = 54 using ValidateCompletionCallback =
58 base::Callback<void(const std::string&, UserCloudPolicyValidator*)>; 55 base::Callback<void(const std::string&, UserCloudPolicyValidator*)>;
59 56
60 // Called back by |session_manager_client_| after policy retrieval. Checks for 57 // Called back by |session_manager_client_| after policy retrieval. Checks for
61 // success and triggers policy validation. 58 // success and triggers policy validation.
62 void ValidateLoadedPolicyBlob(bool validate_in_background, 59 void ValidateLoadedPolicyBlob(
63 const std::string& policy_blob); 60 bool validate_in_background,
61 const std::string& policy_blob,
62 chromeos::SessionManagerClient::RetrievePolicyResponseType response_type);
64 63
65 // Updates state after validation and notifies observers. 64 // Updates state after validation and notifies observers.
66 void UpdatePolicy(const std::string& signature_validation_public_key, 65 void UpdatePolicy(const std::string& signature_validation_public_key,
67 UserCloudPolicyValidator* validator); 66 UserCloudPolicyValidator* validator);
68 67
69 // Sends the policy blob to session_manager for storing after validation. 68 // Sends the policy blob to session_manager for storing after validation.
70 void StoreValidatedPolicy( 69 void StoreValidatedPolicy(
71 const std::string& signature_validation_public_key_unused, 70 const std::string& signature_validation_public_key_unused,
72 UserCloudPolicyValidator* validator); 71 UserCloudPolicyValidator* validator);
73 72
(...skipping 23 matching lines...) Expand all
97 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; 96 scoped_refptr<base::SequencedTaskRunner> background_task_runner_;
98 97
99 base::WeakPtrFactory<DeviceLocalAccountPolicyStore> weak_factory_; 98 base::WeakPtrFactory<DeviceLocalAccountPolicyStore> weak_factory_;
100 99
101 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyStore); 100 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyStore);
102 }; 101 };
103 102
104 } // namespace policy 103 } // namespace policy
105 104
106 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_ 105 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698