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

Unified Diff: ios/chrome/common/physical_web/physical_web_device.mm

Issue 2023833002: [iOS] Upstream physical web classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment about limiting the dependencies Created 4 years, 7 months 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: ios/chrome/common/physical_web/physical_web_device.mm
diff --git a/ios/chrome/common/physical_web/physical_web_device.mm b/ios/chrome/common/physical_web/physical_web_device.mm
new file mode 100644
index 0000000000000000000000000000000000000000..dc6553d491441472d833f9e9e85f5da34b4c4126
--- /dev/null
+++ b/ios/chrome/common/physical_web/physical_web_device.mm
@@ -0,0 +1,73 @@
+// Copyright 2015 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.
+
+#import "ios/chrome/common/physical_web/physical_web_device.h"
+
+#include "base/logging.h"
+#include "base/mac/scoped_nsobject.h"
+#include "ios/chrome/common/physical_web/physical_web_types.h"
+
+@implementation PhysicalWebDevice {
+ base::scoped_nsobject<NSURL> url_;
+ base::scoped_nsobject<NSURL> requestURL_;
+ base::scoped_nsobject<NSURL> icon_;
+ base::scoped_nsobject<NSString> title_;
+ base::scoped_nsobject<NSString> description_;
+ int rssi_;
+ int transmitPower_;
+ double rank_;
+}
+
+@synthesize rssi = rssi_;
+@synthesize transmitPower = transmitPower_;
+@synthesize rank = rank_;
+
+- (instancetype)initWithURL:(NSURL*)url
+ requestURL:(NSURL*)requestURL
+ icon:(NSURL*)icon
+ title:(NSString*)title
+ description:(NSString*)description
+ transmitPower:(int)transmitPower
+ rssi:(int)rssi
+ rank:(double)rank {
+ self = [super init];
+ if (self) {
+ url_.reset([url retain]);
+ requestURL_.reset([requestURL retain]);
+ icon_.reset([icon retain]);
+ title_.reset([title copy]);
+ description_.reset([description copy]);
+ transmitPower_ = transmitPower;
+ rssi_ = rssi;
+ rank_ = rank > physical_web::kMaxRank ? physical_web::kMaxRank : rank;
+ }
+ return self;
+}
+
+- (instancetype)init {
+ NOTREACHED();
+ return nil;
+}
+
+- (NSURL*)url {
+ return url_;
+}
+
+- (NSURL*)requestURL {
+ return requestURL_;
+}
+
+- (NSURL*)icon {
+ return icon_;
+}
+
+- (NSString*)title {
+ return title_;
+}
+
+- (NSString*)description {
+ return description_;
+}
+
+@end
« no previous file with comments | « ios/chrome/common/physical_web/physical_web_device.h ('k') | ios/chrome/common/physical_web/physical_web_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698