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

Side by Side Diff: chrome/browser/policy/device_policy_identity_strategy.cc

Issue 7324017: Split SystemAccess into TimezoneSettings, StatisticsProvider, and SyslogsProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 5 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/policy/device_policy_identity_strategy.h" 5 #include "chrome/browser/policy/device_policy_identity_strategy.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/cros/cros_library.h" 8 #include "chrome/browser/chromeos/cros/cros_library.h"
9 #include "chrome/browser/chromeos/login/ownership_service.h" 9 #include "chrome/browser/chromeos/login/ownership_service.h"
10 #include "chrome/browser/chromeos/login/user_manager.h" 10 #include "chrome/browser/chromeos/login/user_manager.h"
11 #include "chrome/browser/chromeos/system_access.h" 11 #include "chrome/browser/chromeos/system/statistics_provider.h"
12 #include "chrome/browser/net/gaia/token_service.h" 12 #include "chrome/browser/net/gaia/token_service.h"
13 #include "chrome/browser/policy/proto/device_management_constants.h" 13 #include "chrome/browser/policy/proto/device_management_constants.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/common/guid.h" 16 #include "chrome/common/guid.h"
17 #include "chrome/common/net/gaia/gaia_constants.h" 17 #include "chrome/common/net/gaia/gaia_constants.h"
18 #include "content/common/notification_service.h" 18 #include "content/common/notification_service.h"
19 #include "content/common/notification_type.h" 19 #include "content/common/notification_type.h"
20 20
21 // MachineInfo key names. 21 // MachineInfo key names.
22 static const char kMachineInfoSystemHwqual[] = "hardware_class"; 22 static const char kMachineInfoSystemHwqual[] = "hardware_class";
23 static const char kMachineInfoSerialNumber[] = "serial_number"; 23 static const char kMachineInfoSerialNumber[] = "serial_number";
24 24
25 namespace policy { 25 namespace policy {
26 26
27 DevicePolicyIdentityStrategy::DevicePolicyIdentityStrategy() { 27 DevicePolicyIdentityStrategy::DevicePolicyIdentityStrategy() {
28 chromeos::SystemAccess* sys_lib = chromeos::SystemAccess::GetInstance(); 28 chromeos::system::StatisticsProvider* provider =
29 chromeos::system::StatisticsProvider::GetInstance();
29 30
30 if (!sys_lib->GetMachineStatistic(kMachineInfoSystemHwqual, 31 if (!provider->GetMachineStatistic(kMachineInfoSystemHwqual,
31 &machine_model_)) { 32 &machine_model_)) {
32 LOG(ERROR) << "Failed to get machine model."; 33 LOG(ERROR) << "Failed to get machine model.";
33 } 34 }
34 if (!sys_lib->GetMachineStatistic(kMachineInfoSerialNumber, 35 if (!provider->GetMachineStatistic(kMachineInfoSerialNumber,
35 &machine_id_)) { 36 &machine_id_)) {
36 LOG(ERROR) << "Failed to get machine serial number."; 37 LOG(ERROR) << "Failed to get machine serial number.";
37 } 38 }
38 } 39 }
39 40
40 DevicePolicyIdentityStrategy::~DevicePolicyIdentityStrategy() { 41 DevicePolicyIdentityStrategy::~DevicePolicyIdentityStrategy() {
41 } 42 }
42 43
43 std::string DevicePolicyIdentityStrategy::GetDeviceToken() { 44 std::string DevicePolicyIdentityStrategy::GetDeviceToken() {
44 return device_token_; 45 return device_token_;
45 } 46 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 97
97 return !username->empty() && !auth_token->empty(); 98 return !username->empty() && !auth_token->empty();
98 } 99 }
99 100
100 void DevicePolicyIdentityStrategy::OnDeviceTokenAvailable( 101 void DevicePolicyIdentityStrategy::OnDeviceTokenAvailable(
101 const std::string& token) { 102 const std::string& token) {
102 device_token_ = token; 103 device_token_ = token;
103 } 104 }
104 105
105 } // namespace policy 106 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_management_backend_impl.cc ('k') | chrome/browser/ui/webui/bug_report_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698