Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6610)

Unified Diff: chrome/browser/chrome_to_mobile/receive/chrome_to_mobile_receive_util_ios.mm

Issue 11038063: Support chrome_to_mobile job receiving Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix format Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698