| 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 #include "chrome/browser/chromeos/policy/device_status_collector.h" | 5 #include "chrome/browser/chromeos/policy/device_status_collector.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "base/sys_info.h" | 27 #include "base/sys_info.h" |
| 28 #include "base/task_runner_util.h" | 28 #include "base/task_runner_util.h" |
| 29 #include "base/values.h" | 29 #include "base/values.h" |
| 30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
| 31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 32 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 32 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 33 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 33 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 34 #include "chrome/browser/chromeos/policy/device_local_account.h" | 34 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 35 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 35 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 36 #include "chrome/browser/chromeos/settings/cros_settings.h" | 36 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 37 #include "chrome/common/chrome_version_info.h" | |
| 38 #include "chrome/common/pref_names.h" | 37 #include "chrome/common/pref_names.h" |
| 39 #include "chromeos/disks/disk_mount_manager.h" | 38 #include "chromeos/disks/disk_mount_manager.h" |
| 40 #include "chromeos/network/device_state.h" | 39 #include "chromeos/network/device_state.h" |
| 41 #include "chromeos/network/network_handler.h" | 40 #include "chromeos/network/network_handler.h" |
| 42 #include "chromeos/network/network_state.h" | 41 #include "chromeos/network/network_state.h" |
| 43 #include "chromeos/network/network_state_handler.h" | 42 #include "chromeos/network/network_state_handler.h" |
| 44 #include "chromeos/settings/cros_settings_names.h" | 43 #include "chromeos/settings/cros_settings_names.h" |
| 45 #include "chromeos/system/statistics_provider.h" | 44 #include "chromeos/system/statistics_provider.h" |
| 46 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 45 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 47 #include "components/user_manager/user.h" | 46 #include "components/user_manager/user.h" |
| 48 #include "components/user_manager/user_manager.h" | 47 #include "components/user_manager/user_manager.h" |
| 49 #include "components/user_manager/user_type.h" | 48 #include "components/user_manager/user_type.h" |
| 49 #include "components/version_info/version_info.h" |
| 50 #include "content/public/browser/browser_thread.h" | 50 #include "content/public/browser/browser_thread.h" |
| 51 #include "extensions/browser/extension_registry.h" | 51 #include "extensions/browser/extension_registry.h" |
| 52 #include "extensions/common/extension.h" | 52 #include "extensions/common/extension.h" |
| 53 #include "policy/proto/device_management_backend.pb.h" | 53 #include "policy/proto/device_management_backend.pb.h" |
| 54 #include "storage/browser/fileapi/external_mount_points.h" | 54 #include "storage/browser/fileapi/external_mount_points.h" |
| 55 #include "third_party/cros_system_api/dbus/service_constants.h" | 55 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 56 | 56 |
| 57 using base::Time; | 57 using base::Time; |
| 58 using base::TimeDelta; | 58 using base::TimeDelta; |
| 59 | 59 |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 duration_for_last_reported_day_ = activity_milliseconds; | 672 duration_for_last_reported_day_ = activity_milliseconds; |
| 673 } | 673 } |
| 674 } else { | 674 } else { |
| 675 NOTREACHED(); | 675 NOTREACHED(); |
| 676 } | 676 } |
| 677 } | 677 } |
| 678 } | 678 } |
| 679 | 679 |
| 680 void DeviceStatusCollector::GetVersionInfo( | 680 void DeviceStatusCollector::GetVersionInfo( |
| 681 em::DeviceStatusReportRequest* request) { | 681 em::DeviceStatusReportRequest* request) { |
| 682 chrome::VersionInfo version_info; | 682 request->set_browser_version(version_info::GetVersionNumber()); |
| 683 request->set_browser_version(version_info.Version()); | |
| 684 request->set_os_version(os_version_); | 683 request->set_os_version(os_version_); |
| 685 request->set_firmware_version(firmware_version_); | 684 request->set_firmware_version(firmware_version_); |
| 686 } | 685 } |
| 687 | 686 |
| 688 void DeviceStatusCollector::GetBootMode( | 687 void DeviceStatusCollector::GetBootMode( |
| 689 em::DeviceStatusReportRequest* request) { | 688 em::DeviceStatusReportRequest* request) { |
| 690 std::string dev_switch_mode; | 689 std::string dev_switch_mode; |
| 691 if (statistics_provider_->GetMachineStatistic( | 690 if (statistics_provider_->GetMachineStatistic( |
| 692 chromeos::system::kDevSwitchBootKey, &dev_switch_mode)) { | 691 chromeos::system::kDevSwitchBootKey, &dev_switch_mode)) { |
| 693 if (dev_switch_mode == chromeos::system::kDevSwitchBootValueDev) | 692 if (dev_switch_mode == chromeos::system::kDevSwitchBootValueDev) |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 ScheduleGeolocationUpdateRequest(); | 1045 ScheduleGeolocationUpdateRequest(); |
| 1047 } | 1046 } |
| 1048 | 1047 |
| 1049 void DeviceStatusCollector::ReceiveVolumeInfo( | 1048 void DeviceStatusCollector::ReceiveVolumeInfo( |
| 1050 const std::vector<em::VolumeInfo>& info) { | 1049 const std::vector<em::VolumeInfo>& info) { |
| 1051 if (report_hardware_status_) | 1050 if (report_hardware_status_) |
| 1052 volume_info_ = info; | 1051 volume_info_ = info; |
| 1053 } | 1052 } |
| 1054 | 1053 |
| 1055 } // namespace policy | 1054 } // namespace policy |
| OLD | NEW |