David Pursell | e5ebdae | 2014-11-04 08:51:37 -0800 | [diff] [blame] | 1 | // Copyright 2014 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef DEBUGD_SRC_DEV_FEATURES_TOOL_H_ |
| 6 | #define DEBUGD_SRC_DEV_FEATURES_TOOL_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/macros.h> |
Eric Caruso | cc7106c | 2017-04-27 14:22:42 -0700 | [diff] [blame] | 11 | #include <brillo/errors/error.h> |
David Pursell | e5ebdae | 2014-11-04 08:51:37 -0800 | [diff] [blame] | 12 | |
| 13 | namespace debugd { |
| 14 | |
| 15 | // A collection of functions to enable various development features. |
| 16 | // |
| 17 | // Each feature has two associated functions, one to enable the feature and one |
| 18 | // to query whether it's been enabled or not. |
| 19 | class DevFeaturesTool { |
| 20 | public: |
| 21 | DevFeaturesTool() = default; |
Qijiang Fan | 6bc59e1 | 2020-11-11 02:51:06 +0900 | [diff] [blame] | 22 | DevFeaturesTool(const DevFeaturesTool&) = delete; |
| 23 | DevFeaturesTool& operator=(const DevFeaturesTool&) = delete; |
| 24 | |
David Pursell | e5ebdae | 2014-11-04 08:51:37 -0800 | [diff] [blame] | 25 | ~DevFeaturesTool() = default; |
| 26 | |
Eric Caruso | cc7106c | 2017-04-27 14:22:42 -0700 | [diff] [blame] | 27 | bool RemoveRootfsVerification(brillo::ErrorPtr* error) const; |
| 28 | bool EnableBootFromUsb(brillo::ErrorPtr* error) const; |
| 29 | bool ConfigureSshServer(brillo::ErrorPtr* error) const; |
Eric Caruso | 8fe49c7 | 2017-04-25 10:43:59 -0700 | [diff] [blame] | 30 | bool SetUserPassword(const std::string& username, |
David Pursell | e5ebdae | 2014-11-04 08:51:37 -0800 | [diff] [blame] | 31 | const std::string& password, |
Eric Caruso | cc7106c | 2017-04-27 14:22:42 -0700 | [diff] [blame] | 32 | brillo::ErrorPtr* error) const; |
| 33 | bool EnableChromeRemoteDebugging(brillo::ErrorPtr* error) const; |
Eric Caruso | 8fe49c7 | 2017-04-25 10:43:59 -0700 | [diff] [blame] | 34 | bool EnableChromeDevFeatures(const std::string& root_password, |
Eric Caruso | cc7106c | 2017-04-27 14:22:42 -0700 | [diff] [blame] | 35 | brillo::ErrorPtr* error) const; |
David Pursell | e5ebdae | 2014-11-04 08:51:37 -0800 | [diff] [blame] | 36 | |
Eric Caruso | cc7106c | 2017-04-27 14:22:42 -0700 | [diff] [blame] | 37 | bool QueryDevFeatures(int32_t* flags, brillo::ErrorPtr* error) const; |
David Pursell | e5ebdae | 2014-11-04 08:51:37 -0800 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | } // namespace debugd |
| 41 | |
| 42 | #endif // DEBUGD_SRC_DEV_FEATURES_TOOL_H_ |