| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/browser/ui/history/history_collection_view_controller.h" | 5 #include "ios/chrome/browser/ui/history/history_collection_view_controller.h" |
| 6 | 6 |
| 7 #import <MobileCoreServices/MobileCoreServices.h> | 7 #import <MobileCoreServices/MobileCoreServices.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 [self.entryInserter removeSection:section]; | 630 [self.entryInserter removeSection:section]; |
| 631 } | 631 } |
| 632 } | 632 } |
| 633 } | 633 } |
| 634 completion:^(BOOL) { | 634 completion:^(BOOL) { |
| 635 // If only the header section remains, there are no history entries. | 635 // If only the header section remains, there are no history entries. |
| 636 if ([self.collectionViewModel numberOfSections] == 1) { | 636 if ([self.collectionViewModel numberOfSections] == 1) { |
| 637 self.entriesType = NO_ENTRIES; | 637 self.entriesType = NO_ENTRIES; |
| 638 } | 638 } |
| 639 [self updateEntriesStatusMessage]; | 639 [self updateEntriesStatusMessage]; |
| 640 [self.delegate historyCollectionViewControllerDidChangeEntries:self]; |
| 640 }]; | 641 }]; |
| 641 } | 642 } |
| 642 | 643 |
| 643 - (void)filterForHistoryEntries:(NSArray*)entries { | 644 - (void)filterForHistoryEntries:(NSArray*)entries { |
| 644 self.collectionView.allowsMultipleSelection = YES; | 645 self.collectionView.allowsMultipleSelection = YES; |
| 645 for (int section = 1; section < [self.collectionViewModel numberOfSections]; | 646 for (int section = 1; section < [self.collectionViewModel numberOfSections]; |
| 646 ++section) { | 647 ++section) { |
| 647 NSInteger sectionIdentifier = | 648 NSInteger sectionIdentifier = |
| 648 [self.collectionViewModel sectionIdentifierForSection:section]; | 649 [self.collectionViewModel sectionIdentifierForSection:section]; |
| 649 if ([self.collectionViewModel | 650 if ([self.collectionViewModel |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 NSData* plainText = [base::SysUTF8ToNSString(URL.spec()) | 811 NSData* plainText = [base::SysUTF8ToNSString(URL.spec()) |
| 811 dataUsingEncoding:NSUTF8StringEncoding]; | 812 dataUsingEncoding:NSUTF8StringEncoding]; |
| 812 NSDictionary* copiedItem = @{ | 813 NSDictionary* copiedItem = @{ |
| 813 (NSString*)kUTTypeURL : net::NSURLWithGURL(URL), | 814 (NSString*)kUTTypeURL : net::NSURLWithGURL(URL), |
| 814 (NSString*)kUTTypeUTF8PlainText : plainText, | 815 (NSString*)kUTTypeUTF8PlainText : plainText, |
| 815 }; | 816 }; |
| 816 [[UIPasteboard generalPasteboard] setItems:@[ copiedItem ]]; | 817 [[UIPasteboard generalPasteboard] setItems:@[ copiedItem ]]; |
| 817 } | 818 } |
| 818 | 819 |
| 819 @end | 820 @end |
| OLD | NEW |