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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/chrome/common/physical_web/physical_web_device.h"
6
7 #include "base/logging.h"
8 #include "base/mac/scoped_nsobject.h"
9 #include "ios/chrome/common/physical_web/physical_web_types.h"
10
11 @implementation PhysicalWebDevice {
12 base::scoped_nsobject<NSURL> url_;
13 base::scoped_nsobject<NSURL> requestURL_;
14 base::scoped_nsobject<NSURL> icon_;
15 base::scoped_nsobject<NSString> title_;
16 base::scoped_nsobject<NSString> description_;
17 int rssi_;
18 int transmitPower_;
19 double rank_;
20 }
21
22 @synthesize rssi = rssi_;
23 @synthesize transmitPower = transmitPower_;
24 @synthesize rank = rank_;
25
26 - (instancetype)initWithURL:(NSURL*)url
27 requestURL:(NSURL*)requestURL
28 icon:(NSURL*)icon
29 title:(NSString*)title
30 description:(NSString*)description
31 transmitPower:(int)transmitPower
32 rssi:(int)rssi
33 rank:(double)rank {
34 self = [super init];
35 if (self) {
36 url_.reset([url retain]);
37 requestURL_.reset([requestURL retain]);
38 icon_.reset([icon retain]);
39 title_.reset([title copy]);
40 description_.reset([description copy]);
41 transmitPower_ = transmitPower;
42 rssi_ = rssi;
43 rank_ = rank > physical_web::kMaxRank ? physical_web::kMaxRank : rank;
44 }
45 return self;
46 }
47
48 - (instancetype)init {
49 NOTREACHED();
50 return nil;
51 }
52
53 - (NSURL*)url {
54 return url_;
55 }
56
57 - (NSURL*)requestURL {
58 return requestURL_;
59 }
60
61 - (NSURL*)icon {
62 return icon_;
63 }
64
65 - (NSString*)title {
66 return title_;
67 }
68
69 - (NSString*)description {
70 return description_;
71 }
72
73 @end
OLDNEW
« 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