| OLD | NEW |
| 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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // I've filed an issue on me to remove that restriction. | 23 // I've filed an issue on me to remove that restriction. |
| 24 // http://code.google.com/p/chromium-os/issues/detail?id=6415 | 24 // http://code.google.com/p/chromium-os/issues/detail?id=6415 |
| 25 | 25 |
| 26 // The pattern of use here is that the caller instantiates some | 26 // The pattern of use here is that the caller instantiates some |
| 27 // subclass of SignedSettings by calling one of the create | 27 // subclass of SignedSettings by calling one of the create |
| 28 // methods. Then, call Execute() on this object from the UI | 28 // methods. Then, call Execute() on this object from the UI |
| 29 // thread. It'll go off and do work (on the FILE thread and over DBus), | 29 // thread. It'll go off and do work (on the FILE thread and over DBus), |
| 30 // and then call the appropriate method of the Delegate you passed in | 30 // and then call the appropriate method of the Delegate you passed in |
| 31 // -- again, on the UI thread. | 31 // -- again, on the UI thread. |
| 32 | 32 |
| 33 namespace base { |
| 34 class Value; |
| 35 } // namespace base |
| 36 |
| 33 namespace enterprise_management { | 37 namespace enterprise_management { |
| 34 class PolicyFetchResponse; | 38 class PolicyFetchResponse; |
| 35 class PolicyData; | 39 class PolicyData; |
| 36 } // namespace enterprise_management | 40 } // namespace enterprise_management |
| 37 namespace em = enterprise_management; | 41 namespace em = enterprise_management; |
| 38 | 42 |
| 39 namespace chromeos { | 43 namespace chromeos { |
| 40 class OwnershipService; | 44 class OwnershipService; |
| 41 | 45 |
| 42 class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>, | 46 class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 67 SignedSettings::Delegate<bool>* d); | 71 SignedSettings::Delegate<bool>* d); |
| 68 | 72 |
| 69 static SignedSettings* CreateWhitelistOp(const std::string& email, | 73 static SignedSettings* CreateWhitelistOp(const std::string& email, |
| 70 bool add_to_whitelist, | 74 bool add_to_whitelist, |
| 71 SignedSettings::Delegate<bool>* d); | 75 SignedSettings::Delegate<bool>* d); |
| 72 | 76 |
| 73 // These are both "property" operations, and only one instance of | 77 // These are both "property" operations, and only one instance of |
| 74 // one type can be in flight at a time. | 78 // one type can be in flight at a time. |
| 75 static SignedSettings* CreateStorePropertyOp( | 79 static SignedSettings* CreateStorePropertyOp( |
| 76 const std::string& name, | 80 const std::string& name, |
| 77 const std::string& value, | 81 const base::Value& value, |
| 78 SignedSettings::Delegate<bool>* d); | 82 SignedSettings::Delegate<bool>* d); |
| 79 | 83 |
| 80 static SignedSettings* CreateRetrievePropertyOp( | 84 static SignedSettings* CreateRetrievePropertyOp( |
| 81 const std::string& name, | 85 const std::string& name, |
| 82 SignedSettings::Delegate<std::string>* d); | 86 SignedSettings::Delegate<const base::Value*>* d); |
| 83 | 87 |
| 84 // These are both "policy" operations, and only one instance of | 88 // These are both "policy" operations, and only one instance of |
| 85 // one type can be in flight at a time. | 89 // one type can be in flight at a time. |
| 86 static SignedSettings* CreateStorePolicyOp( | 90 static SignedSettings* CreateStorePolicyOp( |
| 87 em::PolicyFetchResponse* policy, | 91 em::PolicyFetchResponse* policy, |
| 88 SignedSettings::Delegate<bool>* d); | 92 SignedSettings::Delegate<bool>* d); |
| 89 | 93 |
| 90 static SignedSettings* CreateRetrievePolicyOp( | 94 static SignedSettings* CreateRetrievePolicyOp( |
| 91 SignedSettings::Delegate<const em::PolicyFetchResponse&>* d); | 95 SignedSettings::Delegate<const em::PolicyFetchResponse&>* d); |
| 92 | 96 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 static const char kDevicePolicyType[]; | 138 static const char kDevicePolicyType[]; |
| 135 | 139 |
| 136 scoped_ptr<Relay> relay_; | 140 scoped_ptr<Relay> relay_; |
| 137 scoped_refptr<SignedSettings> polfetcher_; | 141 scoped_refptr<SignedSettings> polfetcher_; |
| 138 DISALLOW_COPY_AND_ASSIGN(SignedSettings); | 142 DISALLOW_COPY_AND_ASSIGN(SignedSettings); |
| 139 }; | 143 }; |
| 140 | 144 |
| 141 } // namespace chromeos | 145 } // namespace chromeos |
| 142 | 146 |
| 143 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_H_ | 147 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_H_ |
| OLD | NEW |