summaryrefslogtreecommitdiffstats
path: root/sync/util
diff options
context:
space:
mode:
authorblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 22:23:55 +0000
committerblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 22:23:55 +0000
commitcdf740538b89917805a0e3717b68203508ac6359 (patch)
treed5fefec2805e2baeb3dbc92149c6916ee2903dad /sync/util
parent499de56eca20067b4ee4c31ea0ed735376d67154 (diff)
downloadchromium_src-cdf740538b89917805a0e3717b68203508ac6359.zip
chromium_src-cdf740538b89917805a0e3717b68203508ac6359.tar.gz
chromium_src-cdf740538b89917805a0e3717b68203508ac6359.tar.bz2
Bring up minimal sync and sync unittest targets on iOS.
The sync implementation is not yet complete (e.g., there is not yet an invalidator_factory implementation on iOS), but enough of the structure is in place to allow for the sync target to build and a reduced set of unittests to run successfully. Review URL: https://chromiumcodereview.appspot.com/11360194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/util')
-rw-r--r--sync/util/get_session_name.cc4
-rw-r--r--sync/util/get_session_name_ios.h18
-rw-r--r--sync/util/get_session_name_ios.mm19
3 files changed, 41 insertions, 0 deletions
diff --git a/sync/util/get_session_name.cc b/sync/util/get_session_name.cc
index 3eede5a..244aa14 100644
--- a/sync/util/get_session_name.cc
+++ b/sync/util/get_session_name.cc
@@ -15,6 +15,8 @@
#include "chrome/browser/chromeos/system/statistics_provider.h"
#elif defined(OS_LINUX)
#include "base/linux_util.h"
+#elif defined(OS_IOS)
+#include "sync/util/get_session_name_ios.h"
#elif defined(OS_MACOSX)
#include "sync/util/get_session_name_mac.h"
#elif defined(OS_WIN)
@@ -44,6 +46,8 @@ std::string GetSessionNameSynchronously() {
session_name = board.substr(0, 6) == "stumpy" ? "Chromebox" : "Chromebook";
#elif defined(OS_LINUX)
session_name = base::GetLinuxDistro();
+#elif defined(OS_IOS)
+ session_name = internal::GetComputerName();
#elif defined(OS_MACOSX)
session_name = internal::GetHardwareModelName();
#elif defined(OS_WIN)
diff --git a/sync/util/get_session_name_ios.h b/sync/util/get_session_name_ios.h
new file mode 100644
index 0000000..15e7e98
--- /dev/null
+++ b/sync/util/get_session_name_ios.h
@@ -0,0 +1,18 @@
+// Copyright 2012 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.
+
+#ifndef SYNC_UTIL_GET_SESSION_NAME_IOS_H_
+#define SYNC_UTIL_GET_SESSION_NAME_IOS_H_
+
+#include <string>
+
+namespace syncer {
+namespace internal {
+
+std::string GetComputerName();
+
+} // namespace internal
+} // namespace syncer
+
+#endif // SYNC_UTIL_GET_SESSION_NAME_IOS_H_
diff --git a/sync/util/get_session_name_ios.mm b/sync/util/get_session_name_ios.mm
new file mode 100644
index 0000000..f9c101b
--- /dev/null
+++ b/sync/util/get_session_name_ios.mm
@@ -0,0 +1,19 @@
+// Copyright 2012 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 "sync/util/get_session_name_ios.h"
+
+#import <UIKit/UIKit.h>
+
+#include "base/sys_string_conversions.h"
+
+namespace syncer {
+namespace internal {
+
+std::string GetComputerName() {
+ return base::SysNSStringToUTF8([[UIDevice currentDevice] name]);
+}
+
+} // namespace internal
+} // namespace syncer