Chromium Code Reviews| Index: chromeos/chromeos_utils.cc |
| diff --git a/chromeos/chromeos_utils.cc b/chromeos/chromeos_utils.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..16c815410b4778c8c532da8f1c285ecf4d7b6765 |
| --- /dev/null |
| +++ b/chromeos/chromeos_utils.cc |
| @@ -0,0 +1,25 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chromeos/chromeos_utils.h" |
| + |
| +#include "base/sys_info.h" |
| + |
| +namespace chromeos { |
| + |
| +namespace { |
| + const char* kChromeboxBoards[] = { "stumpy", "panther" }; |
| +} |
| + |
| +std::string GetChromeDeviceType() { |
| + std::string board = base::SysInfo::GetLsbReleaseBoard(); |
| + for (unsigned int i = 0; i < arraysize(kChromeboxBoards); ++i) { |
| + std::string chromebox = kChromeboxBoards[i]; |
| + if (board.compare(0, chromebox.length(), chromebox) == 0) |
| + return "Chromebox"; |
| + } |
| + return "Chromebook"; |
|
xiyuan
2014/03/15 00:54:56
These are UI facing strings. Shouldn't them be in
Tim Song
2014/03/17 19:12:07
Hmm... there are a few other places that does a ch
xiyuan
2014/03/17 20:04:50
One possible solution is that GetChromeDeviceType
|
| +} |
| + |
| +} // namespace chromeos |