Chromium Code Reviews| Index: ios/chrome/browser/ui/activity_services/share_to_data.mm |
| diff --git a/ios/chrome/browser/ui/activity_services/share_to_data.mm b/ios/chrome/browser/ui/activity_services/share_to_data.mm |
| index 40018418250c8ae64248d14381fe36cf3005777c..3913cb71027459f9318cab19441be219c82ac9ac 100644 |
| --- a/ios/chrome/browser/ui/activity_services/share_to_data.mm |
| +++ b/ios/chrome/browser/ui/activity_services/share_to_data.mm |
| @@ -38,6 +38,7 @@ |
| @synthesize title = title_; |
| @synthesize image = image_; |
| +@synthesize thumbnailGenerator = thumbnailGenerator_; |
| @synthesize isOriginalTitle = isOriginalTitle_; |
| @synthesize isPagePrintable = isPagePrintable_; |
| @@ -47,9 +48,10 @@ |
| } |
| - (id)initWithURL:(const GURL&)url |
| - title:(NSString*)title |
| - isOriginalTitle:(BOOL)isOriginalTitle |
| - isPagePrintable:(BOOL)isPagePrintable { |
| + title:(NSString*)title |
| + isOriginalTitle:(BOOL)isOriginalTitle |
| + isPagePrintable:(BOOL)isPagePrintable |
| + thumbnailGenerator:(ThumbnailGeneratorBlock)thumbnailGenerator { |
| DCHECK(url.is_valid()); |
| DCHECK(title); |
| self = [super init]; |
| @@ -58,6 +60,7 @@ |
| self.title = title; |
|
marq (ping after 24h)
2017/01/26 16:28:09
You shouldn't use setter methods in an initializer
jif
2017/01/27 11:56:11
Done.
|
| self.isOriginalTitle = isOriginalTitle; |
| self.isPagePrintable = isPagePrintable; |
| + self.thumbnailGenerator = thumbnailGenerator; |
| } |
| return self; |
| } |
| @@ -70,25 +73,4 @@ |
| return net::NSURLWithGURL(url_); |
| } |
| -- (BOOL)isEqual:(id)object { |
| - if (![object isMemberOfClass:self.class]) |
| - return NO; |
| - DCHECK(self.url.is_valid()); |
| - DCHECK(self.title); |
| - ShareToData* other = (ShareToData*)object; |
| - return self.url == other.url && [self.title isEqual:other.title] && |
| - self.image == other.image && |
| - self.isOriginalTitle == other.isOriginalTitle; |
| -} |
| - |
| -- (NSUInteger)hash { |
| - DCHECK(self.url.is_valid()); |
| - DCHECK(self.title); |
| - const NSUInteger kPrime = 31; |
| - NSString* urlString = base::SysUTF8ToNSString(self.url.spec()); |
| - return kPrime * kPrime * kPrime * urlString.hash + |
| - kPrime * kPrime * self.title.hash + kPrime * self.image.hash + |
| - (self.isOriginalTitle ? 0 : 1); |
| -} |
| - |
| @end |