diff options
author | kochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 03:06:05 +0000 |
---|---|---|
committer | kochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 03:06:05 +0000 |
commit | 141fee88c95db8e724e9b4a2692b124cb3a80f98 (patch) | |
tree | 499562eb2933d40525044e0557bb84ee94d9496f /sync/util/get_session_name.cc | |
parent | e17fd74ae492c7ef1e1388d9a2ea6a061e33f8ac (diff) | |
download | chromium_src-141fee88c95db8e724e9b4a2692b124cb3a80f98.zip chromium_src-141fee88c95db8e724e9b4a2692b124cb3a80f98.tar.gz chromium_src-141fee88c95db8e724e9b4a2692b124cb3a80f98.tar.bz2 |
Add session name for Chromebox.
For testing, on stumpy open some tabs and sync, then on the other device
click on NTP "other devices" link and see if "chromebox" appears.
BUG=chromium:124916
TEST=manual
Review URL: https://chromiumcodereview.appspot.com/10382034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136230 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/util/get_session_name.cc')
-rw-r--r-- | sync/util/get_session_name.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sync/util/get_session_name.cc b/sync/util/get_session_name.cc index a447b3e..5917191 100644 --- a/sync/util/get_session_name.cc +++ b/sync/util/get_session_name.cc @@ -11,7 +11,9 @@ #include "base/sys_info.h" #include "base/task_runner.h" -#if defined(OS_LINUX) +#if defined(OS_CHROMEOS) +#include "chrome/browser/chromeos/system/statistics_provider.h" +#elif defined(OS_LINUX) #include "base/linux_util.h" #elif defined(OS_MACOSX) #include "sync/util/get_session_name_mac.h" @@ -28,7 +30,16 @@ namespace { std::string GetSessionNameSynchronously() { std::string session_name; #if defined(OS_CHROMEOS) - session_name = "Chromebook"; + // TODO(kochi): This is very ad hoc and fragile. http://crosbug.com/30619. + 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"; #elif defined(OS_LINUX) session_name = base::GetLinuxDistro(); #elif defined(OS_MACOSX) |