OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 16 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
17 #include "chromeos/dbus/cryptohome_client.h" | 17 #include "chromeos/dbus/cryptohome_client.h" |
18 #include "chromeos/dbus/dbus_method_call_status.h" | 18 #include "chromeos/dbus/dbus_method_call_status.h" |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 class CryptohomeLibrary; | 21 class CryptohomeLibrary; |
pneubeck (no reviews)
2013/09/27 08:59:25
unused
satorux1
2013/10/01 05:24:03
Good catch! Done.
| |
22 } | 22 } |
23 | 23 |
24 namespace policy { | 24 namespace policy { |
25 | 25 |
26 // Brokers access to the enterprise-related installation-time attributes on | 26 // Brokers access to the enterprise-related installation-time attributes on |
27 // ChromeOS. | 27 // ChromeOS. |
28 // TODO(zelidrag, mnissler): Rename + move this class - http://crbug.com/249513. | 28 // TODO(zelidrag, mnissler): Rename + move this class - http://crbug.com/249513. |
29 class EnterpriseInstallAttributes { | 29 class EnterpriseInstallAttributes { |
30 public: | 30 public: |
31 // Return codes for LockDevice(). | 31 // Return codes for LockDevice(). |
(...skipping 15 matching lines...) Expand all Loading... | |
47 static const char kUnknownDeviceMode[]; | 47 static const char kUnknownDeviceMode[]; |
48 | 48 |
49 // Field names in the lockbox. | 49 // Field names in the lockbox. |
50 static const char kAttrEnterpriseDeviceId[]; | 50 static const char kAttrEnterpriseDeviceId[]; |
51 static const char kAttrEnterpriseDomain[]; | 51 static const char kAttrEnterpriseDomain[]; |
52 static const char kAttrEnterpriseMode[]; | 52 static const char kAttrEnterpriseMode[]; |
53 static const char kAttrEnterpriseOwned[]; | 53 static const char kAttrEnterpriseOwned[]; |
54 static const char kAttrEnterpriseUser[]; | 54 static const char kAttrEnterpriseUser[]; |
55 static const char kAttrConsumerKioskEnabled[]; | 55 static const char kAttrConsumerKioskEnabled[]; |
56 | 56 |
57 EnterpriseInstallAttributes( | 57 explicit EnterpriseInstallAttributes( |
58 chromeos::CryptohomeLibrary* cryptohome, | |
59 chromeos::CryptohomeClient* cryptohome_client); | 58 chromeos::CryptohomeClient* cryptohome_client); |
60 ~EnterpriseInstallAttributes(); | 59 ~EnterpriseInstallAttributes(); |
61 | 60 |
62 // Reads data from the cache file. The cache file is used to work around slow | 61 // Reads data from the cache file. The cache file is used to work around slow |
63 // cryptohome startup, which takes a while to register its DBus interface. | 62 // cryptohome startup, which takes a while to register its DBus interface. |
64 // See http://crosbug.com/37367 for background on this. | 63 // See http://crosbug.com/37367 for background on this. |
65 void ReadCacheFile(const base::FilePath& cache_file); | 64 void ReadCacheFile(const base::FilePath& cache_file); |
66 | 65 |
67 // Makes sure the local caches for enterprise-related install attributes are | 66 // Makes sure the local caches for enterprise-related install attributes are |
68 // up-to-date with what cryptohome has. This method checks the readiness of | 67 // up-to-date with what cryptohome has. This method checks the readiness of |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 DeviceMode device_mode, | 126 DeviceMode device_mode, |
128 const std::string& device_id, | 127 const std::string& device_id, |
129 const LockResultCallback& callback, | 128 const LockResultCallback& callback, |
130 chromeos::DBusMethodCallStatus call_status, | 129 chromeos::DBusMethodCallStatus call_status, |
131 bool result); | 130 bool result); |
132 | 131 |
133 // Confirms the registered user and invoke the callback. | 132 // Confirms the registered user and invoke the callback. |
134 void OnReadImmutableAttributes(const std::string& user, | 133 void OnReadImmutableAttributes(const std::string& user, |
135 const LockResultCallback& callback); | 134 const LockResultCallback& callback); |
136 | 135 |
137 chromeos::CryptohomeLibrary* cryptohome_; | |
138 chromeos::CryptohomeClient* cryptohome_client_; | 136 chromeos::CryptohomeClient* cryptohome_client_; |
139 | 137 |
140 base::WeakPtrFactory<EnterpriseInstallAttributes> weak_ptr_factory_; | 138 base::WeakPtrFactory<EnterpriseInstallAttributes> weak_ptr_factory_; |
141 | 139 |
142 DISALLOW_COPY_AND_ASSIGN(EnterpriseInstallAttributes); | 140 DISALLOW_COPY_AND_ASSIGN(EnterpriseInstallAttributes); |
143 }; | 141 }; |
144 | 142 |
145 } // namespace policy | 143 } // namespace policy |
146 | 144 |
147 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ | 145 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_ |
OLD | NEW |