Skip to content

Commit

Permalink
Prefix match CHROMEOS_RELEASE_BOARD for checking chromebox.
Browse files Browse the repository at this point in the history
It used to conatin only "stumpy", but recently official image contains
some suffix, and looks like "stumpy-signed-mp-v2keys". That change caused
regression, and this should fix it.

BUG=chromium:126732
TEST=Open some tabs on stumpy and sync, then on the other machine you should see "Chromebox" instead of "Chromebook" in "ohter devices" menu in new tab page.


Review URL: https://chromiumcodereview.appspot.com/10836257

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151839 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
kochi@chromium.org committed Aug 16, 2012
1 parent 9d6fd57 commit 16712da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sync/util/get_session_name.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ namespace {
std::string GetSessionNameSynchronously() {
std::string session_name;
#if defined(OS_CHROMEOS)
// TODO(kochi): This is very ad hoc and fragile. http://crosbug.com/30619.
// TODO(kochi): This is very ad hoc and fragile. http://crbug.com/126732.
std::string board;
const char kMachineInfoBoard[] = "CHROMEOS_RELEASE_BOARD";
chromeos::system::StatisticsProvider* provider =
chromeos::system::StatisticsProvider::GetInstance();
if (!provider->GetMachineStatistic(kMachineInfoBoard, &board))
LOG(ERROR) << "Failed to get board information";
// Currently, only "stumpy" type of board is considered Chromebox, and
// anything else is Chromebook.
session_name = (board == "stumpy") ? "Chromebox" : "Chromebook";
// anything else is Chromebook. On these devices, session_name should look
// like "stumpy-signed-mp-v2keys" etc. The information can be checked on
// "CHROMEOS_RELEASE_BOARD" line in chrome://system.
session_name = board.substr(0, 6) == "stumpy" ? "Chromebox" : "Chromebook";
#elif defined(OS_LINUX)
session_name = base::GetLinuxDistro();
#elif defined(OS_MACOSX)
Expand Down

0 comments on commit 16712da

Please sign in to comment.