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

Side by Side Diff: chrome/browser/chromeos/login/hwid_checker.cc

Issue 17010003: Cleanup of system settings constants (ab)use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/login/hwid_checker.h" 5 #include "chrome/browser/chromeos/login/hwid_checker.h"
6 6
7 #include <cstdio> 7 #include <cstdio>
8 8
9 #include "base/chromeos/chromeos_version.h" 9 #include "base/chromeos/chromeos_version.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 #endif 84 #endif
85 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 85 CommandLine* cmd_line = CommandLine::ForCurrentProcess();
86 if (cmd_line->HasSwitch(::switches::kTestType) || 86 if (cmd_line->HasSwitch(::switches::kTestType) ||
87 cmd_line->HasSwitch(chromeos::switches::kSkipHWIDCheck)) 87 cmd_line->HasSwitch(chromeos::switches::kSkipHWIDCheck))
88 return true; 88 return true;
89 if (!base::chromeos::IsRunningOnChromeOS()) 89 if (!base::chromeos::IsRunningOnChromeOS())
90 return true; 90 return true;
91 std::string hwid; 91 std::string hwid;
92 chromeos::system::StatisticsProvider* stats = 92 chromeos::system::StatisticsProvider* stats =
93 chromeos::system::StatisticsProvider::GetInstance(); 93 chromeos::system::StatisticsProvider::GetInstance();
94 if (!stats->GetMachineStatistic("hardware_class", &hwid)) { 94 if (!stats->GetMachineStatistic(chromeos::system::kHardwareClass, &hwid)) {
95 LOG(ERROR) << "Couldn't get machine statistic 'hardware_class'."; 95 LOG(ERROR) << "Couldn't get machine statistic 'hardware_class'.";
96 return false; 96 return false;
97 } 97 }
98 if (!chromeos::IsHWIDCorrect(hwid)) { 98 if (!chromeos::IsHWIDCorrect(hwid)) {
99 LOG(ERROR) << "Machine has malformed HWID '" << hwid << "'."; 99 LOG(ERROR) << "Machine has malformed HWID '" << hwid << "'.";
100 return false; 100 return false;
101 } 101 }
102 return true; 102 return true;
103 } 103 }
104 104
105 } // namespace chromeos 105 } // namespace chromeos
106 106
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/imageburner/burn_manager.cc ('k') | chrome/browser/chromeos/login/login_display_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698