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

Side by Side Diff: ios/chrome/browser/ui/history/history_collection_view_controller.mm

Issue 2598763002: [ios] Open links in history status message in new tab and add test (Closed)
Patch Set: Remove extra import Created 3 years, 12 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
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // TODO(crbug.com/653547): Remove this once the MDC adds an option for 229 // TODO(crbug.com/653547): Remove this once the MDC adds an option for
230 // preventing the infobar from showing. 230 // preventing the infobar from showing.
231 - (void)updateFooterInfoBarIfNecessary { 231 - (void)updateFooterInfoBarIfNecessary {
232 // No-op. This prevents the default infobar from showing. 232 // No-op. This prevents the default infobar from showing.
233 } 233 }
234 234
235 #pragma mark - HistoryEntriesStatusItemDelegate 235 #pragma mark - HistoryEntriesStatusItemDelegate
236 236
237 - (void)historyEntriesStatusItem:(HistoryEntriesStatusItem*)item 237 - (void)historyEntriesStatusItem:(HistoryEntriesStatusItem*)item
238 didRequestOpenURL:(const GURL&)URL { 238 didRequestOpenURL:(const GURL&)URL {
239 [self openURL:URL]; 239 [self openURLInNewTab:URL];
240 } 240 }
241 241
242 #pragma mark - HistoryEntryInserterDelegate 242 #pragma mark - HistoryEntryInserterDelegate
243 243
244 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter 244 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter
245 didInsertItemAtIndexPath:(NSIndexPath*)indexPath { 245 didInsertItemAtIndexPath:(NSIndexPath*)indexPath {
246 [self.collectionView insertItemsAtIndexPaths:@[ indexPath ]]; 246 [self.collectionView insertItemsAtIndexPaths:@[ indexPath ]];
247 } 247 }
248 248
249 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter 249 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 NSData* plainText = [base::SysUTF8ToNSString(URL.spec()) 782 NSData* plainText = [base::SysUTF8ToNSString(URL.spec())
783 dataUsingEncoding:NSUTF8StringEncoding]; 783 dataUsingEncoding:NSUTF8StringEncoding];
784 NSDictionary* copiedItem = @{ 784 NSDictionary* copiedItem = @{
785 (NSString*)kUTTypeURL : net::NSURLWithGURL(URL), 785 (NSString*)kUTTypeURL : net::NSURLWithGURL(URL),
786 (NSString*)kUTTypeUTF8PlainText : plainText, 786 (NSString*)kUTTypeUTF8PlainText : plainText,
787 }; 787 };
788 [[UIPasteboard generalPasteboard] setItems:@[ copiedItem ]]; 788 [[UIPasteboard generalPasteboard] setItems:@[ copiedItem ]];
789 } 789 }
790 790
791 @end 791 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/history/BUILD.gn ('k') | ios/chrome/browser/ui/history/history_ui_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698