Chromium Code Reviews| Index: chrome/browser/chromeos/policy/device_status_collector.h |
| diff --git a/chrome/browser/chromeos/policy/device_status_collector.h b/chrome/browser/chromeos/policy/device_status_collector.h |
| index 80ee95d17276b9977d90216ef29a94f6aef4a9c5..da5b6132964dd9360649d89c06ab6f5132a7ebdc 100644 |
| --- a/chrome/browser/chromeos/policy/device_status_collector.h |
| +++ b/chrome/browser/chromeos/policy/device_status_collector.h |
| @@ -10,6 +10,7 @@ |
| #include <deque> |
| #include <memory> |
| #include <string> |
| +#include <utility> |
| #include <vector> |
| #include "base/callback_forward.h" |
| @@ -26,6 +27,7 @@ |
| #include "chrome/browser/chromeos/settings/cros_settings.h" |
| #include "chromeos/system/version_loader.h" |
| #include "components/policy/proto/device_management_backend.pb.h" |
| +#include "mojo/public/cpp/bindings/string.h" |
| #include "ui/base/idle/idle.h" |
| namespace chromeos { |
| @@ -68,6 +70,13 @@ class DeviceStatusCollector { |
| using CPUTempFetcher = |
| base::Callback<std::vector<enterprise_management::CPUTempInfo>()>; |
| + // Is passed into asynchronous mojo interface for communicating with Android. |
| + using AndroidStatusReceiver = |
|
ljusten (tachyonic)
2016/10/05 16:10:42
Whoa, double callback all the way!!
phweiss
2016/10/05 16:33:39
Acknowledged.
|
| + base::Callback<void(mojo::String, mojo::String)>; |
| + // Calls the enterprise reporting mojo interface, passing over the |
| + // AndroidStatusReceiver. |
| + using AndroidStatusFetcher = base::Callback<bool(AndroidStatusReceiver)>; |
|
ljusten (tachyonic)
2016/10/05 16:10:42
Can you use const AndroidStatusReceiver & to preve
phweiss
2016/10/05 16:33:39
Done.
|
| + |
| // Called in the UI thread after the device and session status have been |
| // collected asynchronously in GetDeviceAndSessionStatusAsync. Null pointers |
| // indicate errors or that device or session status reporting is disabled. |
| @@ -79,12 +88,12 @@ class DeviceStatusCollector { |
| // CPUStatisticsFetcher and CPUTempFetcher. These callbacks are executed on |
| // Blocking Pool. A null callback can be passed for either parameter, to use |
| // the default implementation. |
| - DeviceStatusCollector( |
| - PrefService* local_state, |
| - chromeos::system::StatisticsProvider* provider, |
| - const VolumeInfoFetcher& volume_info_fetcher, |
| - const CPUStatisticsFetcher& cpu_statistics_fetcher, |
| - const CPUTempFetcher& cpu_temp_fetcher); |
| + DeviceStatusCollector(PrefService* local_state, |
| + chromeos::system::StatisticsProvider* provider, |
| + const VolumeInfoFetcher& volume_info_fetcher, |
| + const CPUStatisticsFetcher& cpu_statistics_fetcher, |
| + const CPUTempFetcher& cpu_temp_fetcher, |
| + const AndroidStatusFetcher& android_status_fetcher_); |
| virtual ~DeviceStatusCollector(); |
| // Gathers device and session status information and calls the passed response |
| @@ -183,6 +192,9 @@ class DeviceStatusCollector { |
| // a |GetStatusState| instance. |
| bool GetAccountStatus( |
| enterprise_management::SessionStatusReportRequest* status); |
| + bool GetAndroidStatus( |
| + enterprise_management::SessionStatusReportRequest* status, |
| + scoped_refptr<GetStatusState> state); // Queues async queries! |
| // Update the cached values of the reporting settings. |
| void UpdateReportingSettings(); |
| @@ -230,6 +242,8 @@ class DeviceStatusCollector { |
| // Callback invoked to fetch information about cpu temperature. |
| CPUTempFetcher cpu_temp_fetcher_; |
| + AndroidStatusFetcher android_status_fetcher_; |
| + |
| chromeos::system::StatisticsProvider* const statistics_provider_; |
| chromeos::CrosSettings* const cros_settings_; |
| @@ -246,6 +260,7 @@ class DeviceStatusCollector { |
| bool report_users_ = false; |
| bool report_hardware_status_ = false; |
| bool report_session_status_ = false; |
| + bool report_android_status_ = false; |
| bool report_os_update_status_ = false; |
| bool report_running_kiosk_app_ = false; |