summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorkochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-10 03:06:05 +0000
committerkochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-10 03:06:05 +0000
commit141fee88c95db8e724e9b4a2692b124cb3a80f98 (patch)
tree499562eb2933d40525044e0557bb84ee94d9496f /sync
parente17fd74ae492c7ef1e1388d9a2ea6a061e33f8ac (diff)
downloadchromium_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')
-rw-r--r--sync/DEPS3
-rw-r--r--sync/sync.gyp7
-rw-r--r--sync/util/get_session_name.cc15
3 files changed, 23 insertions, 2 deletions
diff --git a/sync/DEPS b/sync/DEPS
index e3938ed..3e94044 100644
--- a/sync/DEPS
+++ b/sync/DEPS
@@ -7,6 +7,9 @@ include_rules = [
"+base",
"+build",
"+testing",
+ # TODO(kochi): Remove this hack after "Chromebox" hack in get_session_name.cc
+ # is gone.
+ "+chrome/browser/chromeos/system",
# Force subdirectories to explicitly define DEPS.
"-sync",
diff --git a/sync/sync.gyp b/sync/sync.gyp
index bc6c263..97d493e 100644
--- a/sync/sync.gyp
+++ b/sync/sync.gyp
@@ -612,6 +612,13 @@
'../base/allocator/allocator.gyp:allocator',
],
}],
+ ['OS=="linux" and chromeos==1', {
+ # TODO(kochi): Remove this once we get rid of dependency from
+ # get_session_name.cc.
+ 'dependencies': [
+ '../chrome/chrome.gyp:browser',
+ ],
+ }],
],
},
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)