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

Side by Side Diff: chrome/browser/chromeos/cros/login_library.h

Issue 7233006: Store/Retrieve CrOS user policy in session_manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_CROS_LOGIN_LIBRARY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/singleton.h" 11 #include "base/memory/singleton.h"
12 #include "third_party/cros/chromeos_login.h" 12 #include "third_party/cros/chromeos_login.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 // This interface defines the interaction with the ChromeOS login library APIs. 16 // This interface defines the interaction with the ChromeOS login library APIs.
17 class LoginLibrary { 17 class LoginLibrary {
18 public: 18 public:
19 virtual ~LoginLibrary(); 19 virtual ~LoginLibrary();
20 // Requests that the Upstart signal login-prompt-ready be emitted. 20 // Requests that the Upstart signal login-prompt-ready be emitted.
21 virtual bool EmitLoginPromptReady() = 0; 21 virtual bool EmitLoginPromptReady() = 0;
22 22
23 // Starts a policy retrieval operation. The result will be reported through
24 // |callback|, passing |delegate| verbatimely as the first parameter.
23 virtual void RequestRetrievePolicy(RetrievePolicyCallback callback, 25 virtual void RequestRetrievePolicy(RetrievePolicyCallback callback,
gfeher 2011/07/21 12:24:23 Is this about device policies? Then please rename
Mattias Nissler (ping if slow) 2011/07/21 14:20:25 You are right in that changing the names would be
gfeher 2011/07/21 23:37:14 My choice: leave it like this for now and do the f
Mattias Nissler (ping if slow) 2011/07/22 11:29:47 Done.
24 void* delegate_string) = 0; 26 void* delegate) = 0;
25 27
28 // Starts storing |policy| (which should be the serialized form of a
29 // PolicyFetchResponse protobuf). The result will be reported through
30 // |callback|, passing |delegate| verbatimely as the first parameter.
26 virtual void RequestStorePolicy(const std::string& policy, 31 virtual void RequestStorePolicy(const std::string& policy,
gfeher 2011/07/21 12:24:23 Same here.
Mattias Nissler (ping if slow) 2011/07/21 14:20:25 Same reply.
27 StorePolicyCallback callback, 32 StorePolicyCallback callback,
28 void* delegate_bool) = 0; 33 void* delegate) = 0;
34
35 // Starts a user policy retrieval operation for the current user. The result
36 // will be reported through |callback|, passing |delegate| verbatimely as the
37 // first parameter.
38 virtual void RequestRetrieveUserPolicy(RetrievePolicyCallback callback,
39 void* delegate) = 0;
40
41 // Stores user policy for the current user. The policy data is in |policy|,
42 // which should be a serialized PolicyFetchResponse protobuf. The result will
43 // be reported through |callback|, passing |delegate| verbatimely as the first
44 // parameter.
45 virtual void RequestStoreUserPolicy(const std::string& policy,
46 StorePolicyCallback callback,
47 void* delegate) = 0;
29 48
30 // Tells the session manager to start a logged-in session for the user 49 // Tells the session manager to start a logged-in session for the user
31 // |user_email|. |unique_id| is meant to be used when we have a non-human- 50 // |user_email|. |unique_id| is meant to be used when we have a non-human-
32 // readable unique identifier by which we distinguish users (to deal with 51 // readable unique identifier by which we distinguish users (to deal with
33 // potential email address changes over time). 52 // potential email address changes over time).
34 virtual bool StartSession(const std::string& user_email, 53 virtual bool StartSession(const std::string& user_email,
35 const std::string& unique_id /* unused */) = 0; 54 const std::string& unique_id /* unused */) = 0;
36 55
37 // Tells the session manager to terminate the current logged-in session. 56 // Tells the session manager to terminate the current logged-in session.
38 // In the event that we ever support multiple simultaneous user sessions, 57 // In the event that we ever support multiple simultaneous user sessions,
39 // This will tell the session manager to terminate the session for the user 58 // This will tell the session manager to terminate the session for the user
40 // indicated by |unique_id|. 59 // indicated by |unique_id|.
41 virtual bool StopSession(const std::string& unique_id /* unused */) = 0; 60 virtual bool StopSession(const std::string& unique_id /* unused */) = 0;
42 61
43 // Restarts the Enterprise Daemon. 62 // Restarts the Enterprise Daemon.
44 virtual bool RestartEntd() = 0; 63 virtual bool RestartEntd() = 0;
45 64
46 // Restarts the job with specified command line string. 65 // Restarts the job with specified command line string.
47 virtual bool RestartJob(int pid, const std::string& command_line) = 0; 66 virtual bool RestartJob(int pid, const std::string& command_line) = 0;
48 67
49 // Factory function, creates a new instance and returns ownership. 68 // Factory function, creates a new instance and returns ownership.
50 // For normal usage, access the singleton via CrosLibrary::Get(). 69 // For normal usage, access the singleton via CrosLibrary::Get().
51 static LoginLibrary* GetImpl(bool stub); 70 static LoginLibrary* GetImpl(bool stub);
52 }; 71 };
53 72
54 } // namespace chromeos 73 } // namespace chromeos
55 74
56 #endif // CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_ 75 #endif // CHROME_BROWSER_CHROMEOS_CROS_LOGIN_LIBRARY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/login_library.cc » ('j') | chrome/browser/policy/cros_user_policy_cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698