Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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/browser/ui/content_suggestions/content_suggestion_id.h" | |
| 6 | |
| 7 #include "base/mac/foundation_util.h" | |
| 8 | |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
| 10 #error "This file requires ARC support." | |
| 11 #endif | |
| 12 | |
| 13 @implementation ContentSuggestionID | |
| 14 | |
| 15 @synthesize sectionInfo = _sectionInfo; | |
| 16 @synthesize IDInSection = _IDInSection; | |
| 17 | |
| 18 #pragma mark - NSObject | |
| 19 | |
| 20 - (BOOL)isEqual:(id)object { | |
| 21 if (self == object) { | |
| 22 return YES; | |
| 23 } | |
| 24 | |
| 25 if (![object isKindOfClass:[ContentSuggestionID class]]) { | |
| 26 return NO; | |
| 27 } | |
| 28 | |
| 29 ContentSuggestionID* other = | |
| 30 base::mac::ObjCCastStrict<ContentSuggestionID>(object); | |
| 31 | |
| 32 return self.sectionInfo == other.sectionInfo && | |
| 33 self.IDInSection == other.IDInSection; | |
|
lpromero
2017/02/21 10:33:34
Unittests for equality.
gambard
2017/02/21 14:37:48
Done.
| |
| 34 } | |
| 35 | |
| 36 @end | |
| OLD | NEW |