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

Side by Side Diff: chrome/browser/chromeos/login/signed_settings_helper.h

Issue 8163011: PART3: Removed whitelist special ops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT where both previous parts are committed. Created 9 years, 1 month 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_LOGIN_SIGNED_SETTINGS_HELPER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 10 matching lines...) Expand all
21 namespace chromeos { 21 namespace chromeos {
22 22
23 class SignedSettings; 23 class SignedSettings;
24 24
25 // Helper to serialize signed settings ops, provide unified callback interface, 25 // Helper to serialize signed settings ops, provide unified callback interface,
26 // and handle callbacks destruction before ops completion. 26 // and handle callbacks destruction before ops completion.
27 class SignedSettingsHelper { 27 class SignedSettingsHelper {
28 public: 28 public:
29 class Callback { 29 class Callback {
30 public: 30 public:
31 // Callback of CheckWhitelistOp. |success| indicates whether the op succeeds
32 // or not. |email| is the email that is checked against.
33 virtual void OnCheckWhitelistCompleted(
34 SignedSettings::ReturnCode code,
35 const std::string& email) {}
36
37 // Callback of WhitelistOp that adds |email| to the whitelist.
38 virtual void OnWhitelistCompleted(
39 SignedSettings::ReturnCode code, const std::string& email) {}
40
41 // Callback of WhitelistOp that removes |email| to the whitelist.
42 virtual void OnUnwhitelistCompleted(
43 SignedSettings::ReturnCode code, const std::string& email) {}
44
45 // Callback of StorePropertyOp. 31 // Callback of StorePropertyOp.
46 virtual void OnStorePropertyCompleted( 32 virtual void OnStorePropertyCompleted(
47 SignedSettings::ReturnCode code, 33 SignedSettings::ReturnCode code,
48 const std::string& name, 34 const std::string& name,
49 const base::Value& value) {} 35 const base::Value& value) {}
50 36
51 // Callback of RetrievePropertyOp. 37 // Callback of RetrievePropertyOp.
52 virtual void OnRetrievePropertyCompleted( 38 virtual void OnRetrievePropertyCompleted(
53 SignedSettings::ReturnCode code, 39 SignedSettings::ReturnCode code,
54 const std::string& name, 40 const std::string& name,
55 const base::Value* value) {} 41 const base::Value* value) {}
56 42
57 // Callback of StorePolicyOp. 43 // Callback of StorePolicyOp.
58 virtual void OnStorePolicyCompleted( 44 virtual void OnStorePolicyCompleted(
59 SignedSettings::ReturnCode code) {} 45 SignedSettings::ReturnCode code) {}
60 46
61 // Callback of RetrievePolicyOp. 47 // Callback of RetrievePolicyOp.
62 virtual void OnRetrievePolicyCompleted( 48 virtual void OnRetrievePolicyCompleted(
63 SignedSettings::ReturnCode code, 49 SignedSettings::ReturnCode code,
64 const em::PolicyFetchResponse& policy) {} 50 const em::PolicyFetchResponse& policy) {}
65 }; 51 };
66 52
67 // Class factory 53 // Class factory
68 static SignedSettingsHelper* Get(); 54 static SignedSettingsHelper* Get();
69 55
70 // Functions to start signed settings ops. 56 // Functions to start signed settings ops.
71 virtual void StartCheckWhitelistOp(const std::string& email,
72 Callback* callback) = 0;
73 virtual void StartWhitelistOp(const std::string& email,
74 bool add_to_whitelist,
75 Callback* callback) = 0;
76 virtual void StartStorePropertyOp(const std::string& name, 57 virtual void StartStorePropertyOp(const std::string& name,
77 const base::Value& value, 58 const base::Value& value,
78 Callback* callback) = 0; 59 Callback* callback) = 0;
79 virtual void StartRetrieveProperty(const std::string& name, 60 virtual void StartRetrieveProperty(const std::string& name,
80 Callback* callback) = 0; 61 Callback* callback) = 0;
81 virtual void StartStorePolicyOp(const em::PolicyFetchResponse& policy, 62 virtual void StartStorePolicyOp(const em::PolicyFetchResponse& policy,
82 Callback* callback) = 0; 63 Callback* callback) = 0;
83 virtual void StartRetrievePolicyOp(Callback* callback) = 0; 64 virtual void StartRetrievePolicyOp(Callback* callback) = 0;
84 65
85 // Cancels all pending calls of given callback. 66 // Cancels all pending calls of given callback.
(...skipping 15 matching lines...) Expand all
101 protected: 82 protected:
102 SignedSettingsHelper() : test_delegate_(NULL) { 83 SignedSettingsHelper() : test_delegate_(NULL) {
103 } 84 }
104 85
105 TestDelegate* test_delegate_; 86 TestDelegate* test_delegate_;
106 }; 87 };
107 88
108 } // namespace chromeos 89 } // namespace chromeos
109 90
110 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_ 91 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/signed_settings.cc ('k') | chrome/browser/chromeos/login/signed_settings_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698