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

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

Issue 2890433002: Revert "Abandon user sign in when policy is retrieved before session started." (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_local_account_policy_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
18 #include "components/policy/core/common/cloud/cloud_policy_validator.h" 17 #include "components/policy/core/common/cloud/cloud_policy_validator.h"
19 #include "components/policy/core/common/cloud/user_cloud_policy_store_base.h" 18 #include "components/policy/core/common/cloud/user_cloud_policy_store_base.h"
20 19
21 namespace base { 20 namespace base {
22 class SequencedTaskRunner; 21 class SequencedTaskRunner;
23 } 22 }
24 23
24 namespace chromeos {
25 class SessionManagerClient;
26 }
27
25 namespace enterprise_management { 28 namespace enterprise_management {
26 class PolicyFetchResponse; 29 class PolicyFetchResponse;
27 } 30 }
28 31
29 namespace policy { 32 namespace policy {
30 33
31 // CloudPolicyStore implementation for device-local account policy. Stores/loads 34 // CloudPolicyStore implementation for device-local account policy. Stores/loads
32 // policy to/from session_manager. 35 // policy to/from session_manager.
33 class DeviceLocalAccountPolicyStore : public UserCloudPolicyStoreBase { 36 class DeviceLocalAccountPolicyStore : public UserCloudPolicyStoreBase {
34 public: 37 public:
(...skipping 14 matching lines...) Expand all
49 void LoadImmediately(); 52 void LoadImmediately();
50 53
51 private: 54 private:
52 // The callback invoked once policy validation is complete. Passed are the 55 // The callback invoked once policy validation is complete. Passed are the
53 // used public key and the validator. 56 // used public key and the validator.
54 using ValidateCompletionCallback = 57 using ValidateCompletionCallback =
55 base::Callback<void(const std::string&, UserCloudPolicyValidator*)>; 58 base::Callback<void(const std::string&, UserCloudPolicyValidator*)>;
56 59
57 // Called back by |session_manager_client_| after policy retrieval. Checks for 60 // Called back by |session_manager_client_| after policy retrieval. Checks for
58 // success and triggers policy validation. 61 // success and triggers policy validation.
59 void ValidateLoadedPolicyBlob( 62 void ValidateLoadedPolicyBlob(bool validate_in_background,
60 bool validate_in_background, 63 const std::string& policy_blob);
61 const std::string& policy_blob,
62 chromeos::SessionManagerClient::RetrievePolicyResponseType response_type);
63 64
64 // Updates state after validation and notifies observers. 65 // Updates state after validation and notifies observers.
65 void UpdatePolicy(const std::string& signature_validation_public_key, 66 void UpdatePolicy(const std::string& signature_validation_public_key,
66 UserCloudPolicyValidator* validator); 67 UserCloudPolicyValidator* validator);
67 68
68 // Sends the policy blob to session_manager for storing after validation. 69 // Sends the policy blob to session_manager for storing after validation.
69 void StoreValidatedPolicy( 70 void StoreValidatedPolicy(
70 const std::string& signature_validation_public_key_unused, 71 const std::string& signature_validation_public_key_unused,
71 UserCloudPolicyValidator* validator); 72 UserCloudPolicyValidator* validator);
72 73
(...skipping 23 matching lines...) Expand all
96 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; 97 scoped_refptr<base::SequencedTaskRunner> background_task_runner_;
97 98
98 base::WeakPtrFactory<DeviceLocalAccountPolicyStore> weak_factory_; 99 base::WeakPtrFactory<DeviceLocalAccountPolicyStore> weak_factory_;
99 100
100 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyStore); 101 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyStore);
101 }; 102 };
102 103
103 } // namespace policy 104 } // namespace policy
104 105
105 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_ 106 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_local_account_policy_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698