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> |
11 | 11 |
| 12 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "chrome/browser/chromeos/login/owner_manager.h" | 14 #include "chrome/browser/chromeos/login/owner_manager.h" |
14 | 15 |
15 // There are two categories of operations that can be performed on the | 16 // There are two categories of operations that can be performed on the |
16 // Chrome OS owner-signed settings store: | 17 // Chrome OS owner-signed settings store: |
17 // 1) doing stuff to the whitelist (adding/removing/checking) | 18 // 1) doing stuff to the whitelist (adding/removing/checking) |
18 // 2) Storing/Retrieving arbitrary name=value pairs | 19 // 2) Storing/Retrieving arbitrary name=value pairs |
19 // | 20 // |
20 // Unfortunately, it is currently a limitation that only one of each | 21 // Unfortunately, it is currently a limitation that only one of each |
21 // category can be in-flight at a time. You can be doing exactly one thing | 22 // category can be in-flight at a time. You can be doing exactly one thing |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 friend class SignedSettingsTest; | 109 friend class SignedSettingsTest; |
109 friend class SignedSettingsHelperTest; | 110 friend class SignedSettingsHelperTest; |
110 | 111 |
111 class Relay | 112 class Relay |
112 : public SignedSettings::Delegate<const em::PolicyFetchResponse&> { | 113 : public SignedSettings::Delegate<const em::PolicyFetchResponse&> { |
113 public: | 114 public: |
114 // |s| must outlive your Relay instance. | 115 // |s| must outlive your Relay instance. |
115 explicit Relay(SignedSettings* s); | 116 explicit Relay(SignedSettings* s); |
116 virtual ~Relay(); | 117 virtual ~Relay(); |
117 // Implementation of SignedSettings::Delegate | 118 // Implementation of SignedSettings::Delegate |
118 virtual void OnSettingsOpCompleted(SignedSettings::ReturnCode code, | 119 virtual void OnSettingsOpCompleted( |
119 const em::PolicyFetchResponse& value); | 120 SignedSettings::ReturnCode code, |
| 121 const em::PolicyFetchResponse& value) OVERRIDE; |
120 private: | 122 private: |
121 SignedSettings* settings_; | 123 SignedSettings* settings_; |
122 DISALLOW_COPY_AND_ASSIGN(Relay); | 124 DISALLOW_COPY_AND_ASSIGN(Relay); |
123 }; | 125 }; |
124 | 126 |
125 // Format of this string is documented in device_management_backend.proto. | 127 // Format of this string is documented in device_management_backend.proto. |
126 static const char kDevicePolicyType[]; | 128 static const char kDevicePolicyType[]; |
127 | 129 |
128 scoped_ptr<Relay> relay_; | 130 scoped_ptr<Relay> relay_; |
129 scoped_refptr<SignedSettings> polfetcher_; | 131 scoped_refptr<SignedSettings> polfetcher_; |
130 DISALLOW_COPY_AND_ASSIGN(SignedSettings); | 132 DISALLOW_COPY_AND_ASSIGN(SignedSettings); |
131 }; | 133 }; |
132 | 134 |
133 } // namespace chromeos | 135 } // namespace chromeos |
134 | 136 |
135 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_H_ | 137 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_H_ |
OLD | NEW |