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

Unified Diff: chromeos/dbus/session_manager_client.h

Issue 2801993002: Abandon user sign in when policy is retrieved before session started (Closed)
Patch Set: Nit 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/session_manager_client.h
diff --git a/chromeos/dbus/session_manager_client.h b/chromeos/dbus/session_manager_client.h
index b294b761c8b9c692d7414f78e8432d46d663ec21..e015f7f5a69d1b6a951b017bdc119953621e4bc3 100644
--- a/chromeos/dbus/session_manager_client.h
+++ b/chromeos/dbus/session_manager_client.h
@@ -27,6 +27,18 @@ namespace chromeos {
// SessionManagerClient is used to communicate with the session manager.
class CHROMEOS_EXPORT SessionManagerClient : public DBusClient {
public:
+ // The result type received from session manager on request to retrieve the
+ // policy.
emaxx 2017/04/18 15:03:17 Please explain in the comment the restriction that
igorcov 2017/04/20 14:52:29 Done.
+ enum RetrievePolicyResponseType {
+ SUCCESS, // The policy retrieved successfully.
+ SESSION_DOES_NOT_EXIST, // Retrieve policy request issued
+ // before session started.
+ OTHER_ERROR, // Other type of error while retrieving
+ // policy.
+ RETRIEVE_POLICY_RESPONSE_TYPE_COUNT // Has to be the last value of
+ // enumeration. Used for UMA.
+ };
+
// Interface for observing changes from the session manager.
class Observer {
public:
@@ -142,10 +154,12 @@ class CHROMEOS_EXPORT SessionManagerClient : public DBusClient {
// Used for RetrieveDevicePolicy, RetrievePolicyForUser and
// RetrieveDeviceLocalAccountPolicy. Takes a serialized protocol buffer as
- // string. Upon success, we will pass a protobuf to the callback. On
- // failure, we will pass "".
+ // string. Upon success, we will pass a protobuf and SUCCESS |response_type|
+ // to the callback. On failure, we will pass "" and the details of error type
+ // in |response_type|.
using RetrievePolicyCallback =
- base::Callback<void(const std::string& protobuf)>;
+ base::Callback<void(const std::string& protobuf,
+ const RetrievePolicyResponseType& response_type)>;
// Fetches the device policy blob stored by the session manager. Upon
// completion of the retrieve attempt, we will call the provided callback.

Powered by Google App Engine
This is Rietveld 408576698