Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/chromeos/policy/device_status_collector.cc

Issue 2557513004: Remove explicit singletonness of ArcBridgeService part 3. (Closed)
Patch Set: Address comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 29 matching lines...) Expand all
40 #include "chromeos/dbus/dbus_thread_manager.h" 40 #include "chromeos/dbus/dbus_thread_manager.h"
41 #include "chromeos/dbus/update_engine_client.h" 41 #include "chromeos/dbus/update_engine_client.h"
42 #include "chromeos/disks/disk_mount_manager.h" 42 #include "chromeos/disks/disk_mount_manager.h"
43 #include "chromeos/network/device_state.h" 43 #include "chromeos/network/device_state.h"
44 #include "chromeos/network/network_handler.h" 44 #include "chromeos/network/network_handler.h"
45 #include "chromeos/network/network_state.h" 45 #include "chromeos/network/network_state.h"
46 #include "chromeos/network/network_state_handler.h" 46 #include "chromeos/network/network_state_handler.h"
47 #include "chromeos/settings/cros_settings_names.h" 47 #include "chromeos/settings/cros_settings_names.h"
48 #include "chromeos/system/statistics_provider.h" 48 #include "chromeos/system/statistics_provider.h"
49 #include "components/arc/arc_bridge_service.h" 49 #include "components/arc/arc_bridge_service.h"
50 #include "components/arc/arc_service_manager.h"
50 #include "components/arc/common/enterprise_reporting.mojom.h" 51 #include "components/arc/common/enterprise_reporting.mojom.h"
51 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 52 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
52 #include "components/policy/proto/device_management_backend.pb.h" 53 #include "components/policy/proto/device_management_backend.pb.h"
53 #include "components/prefs/pref_registry_simple.h" 54 #include "components/prefs/pref_registry_simple.h"
54 #include "components/prefs/pref_service.h" 55 #include "components/prefs/pref_service.h"
55 #include "components/prefs/scoped_user_pref_update.h" 56 #include "components/prefs/scoped_user_pref_update.h"
56 #include "components/user_manager/user.h" 57 #include "components/user_manager/user.h"
57 #include "components/user_manager/user_manager.h" 58 #include "components/user_manager/user_manager.h"
58 #include "components/user_manager/user_type.h" 59 #include "components/user_manager/user_type.h"
59 #include "components/version_info/version_info.h" 60 #include "components/version_info/version_info.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 LOG(WARNING) << "Unable to read CPU temp from " 212 LOG(WARNING) << "Unable to read CPU temp from "
212 << temperature_path.MaybeAsASCII(); 213 << temperature_path.MaybeAsASCII();
213 } 214 }
214 } 215 }
215 } 216 }
216 return contents; 217 return contents;
217 } 218 }
218 219
219 bool ReadAndroidStatus( 220 bool ReadAndroidStatus(
220 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver) { 221 const policy::DeviceStatusCollector::AndroidStatusReceiver& receiver) {
221 auto* const arc_service = arc::ArcBridgeService::Get(); 222 auto* const arc_service_manager = arc::ArcServiceManager::Get();
222 if (!arc_service) 223 if (!arc_service_manager)
223 return false; 224 return false;
224 auto* const instance_holder = arc_service->enterprise_reporting(); 225 auto* const instance_holder =
226 arc_service_manager->arc_bridge_service()->enterprise_reporting();
225 if (!instance_holder) 227 if (!instance_holder)
226 return false; 228 return false;
227 auto* const instance = instance_holder->GetInstanceForMethod("GetStatus", 1); 229 auto* const instance = instance_holder->GetInstanceForMethod("GetStatus", 1);
228 if (!instance) 230 if (!instance)
229 return false; 231 return false;
230 instance->GetStatus(receiver); 232 instance->GetStatus(receiver);
231 return true; 233 return true;
232 } 234 }
233 235
234 // Returns the DeviceLocalAccount associated with the current kiosk session. 236 // Returns the DeviceLocalAccount associated with the current kiosk session.
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 1191
1190 void DeviceStatusCollector::OnOSVersion(const std::string& version) { 1192 void DeviceStatusCollector::OnOSVersion(const std::string& version) {
1191 os_version_ = version; 1193 os_version_ = version;
1192 } 1194 }
1193 1195
1194 void DeviceStatusCollector::OnOSFirmware(const std::string& version) { 1196 void DeviceStatusCollector::OnOSFirmware(const std::string& version) {
1195 firmware_version_ = version; 1197 firmware_version_ = version;
1196 } 1198 }
1197 1199
1198 } // namespace policy 1200 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698