Index: chrome/browser/chrome_to_mobile/receive/chrome_to_mobile_receive_util_ios.mm |
diff --git a/chrome/browser/chrome_to_mobile/receive/chrome_to_mobile_receive_util_ios.mm b/chrome/browser/chrome_to_mobile/receive/chrome_to_mobile_receive_util_ios.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b38e57f54ac185a4522fea51e0b13ebe8249cffa |
--- /dev/null |
+++ b/chrome/browser/chrome_to_mobile/receive/chrome_to_mobile_receive_util_ios.mm |
@@ -0,0 +1,53 @@ |
+// 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 "chrome/browser/chrome_to_mobile/receive/chrome_to_mobile_receive_util.h" |
+ |
+#import <UIKit/UIKit.h> |
+ |
+#include "base/ios/device_util.h" |
+#include "base/sys_string_conversions.h" |
+#include "chrome/common/chrome_version_info.h" |
+ |
+namespace { |
+ |
+const char kApnsDeviceTokenTag[] = "device_token"; |
+const char kApnsPackageTag[] = "package"; |
+ |
+} // namespace |
+ |
+namespace chrome_to_mobile_receive { |
+ |
+const char kProxyTagPrefix[] = "__apns__"; |
+const char kSnapshotOriginalUrlTag[] = "__apns__original_url"; |
+const char kTagsHashTagName[] = "__apns__tagshash"; |
+const char kApnsDeviceTokenTag[] = "device_token"; |
+const char kApnsPackageTag[] = "package"; |
+const char kChromeToMobileClientParameter[] = "chrome-to-mobile-ios"; |
+ |
+std::string GenerateProxyIdValue() { |
+ chrome::VersionInfo version_info; |
+ if (version_info.IsOfficialBuild()) |
+ return ios::device_util::GetDeviceIdentifier(""); |
+ return version_info.Name() + ios::device_util::GetDeviceIdentifier(""); |
+} |
+ |
+std::string GenreatePrinterName() { |
+ return std::string(base::SysNSStringToUTF8([[UIDevice currentDevice] name])); |
+} |
+ |
+std::string GeneratePrinterDescription() { |
+ chrome::VersionInfo version_info; |
+ if (version_info.IsOfficialBuild()) |
+ return base::SysNSStringToUTF8([[UIDevice currentDevice] localizedModel]); |
+ |
+ return version_info.Name() + |
+ base::SysNSStringToUTF8([[UIDevice currentDevice] localizedModel]); |
+} |
+ |
+std::string GeneratePrinterType() { |
+ return std::string("IOS_CHROME_SNAPSHOT"); |
+} |
+ |
+} // namespace chrome_to_mobile_receive |