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

Unified Diff: ios/chrome/browser/ui/activity_services/share_to_data.mm

Issue 2645653003: Expose thumbnails of pages to iOS share extensions. (Closed)
Patch Set: Created 3 years, 11 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/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..c2a88922df395a05cc38ed9ba56cc8ea5eae7837 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:(ThumbnailGenerator)thumbnailGenerator {
DCHECK(url.is_valid());
DCHECK(title);
self = [super init];
@@ -58,6 +60,7 @@
self.title = title;
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

Powered by Google App Engine
This is Rietveld 408576698