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

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: Created 4 years 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // TODO(crbug.com/653547): Remove this once the MDC adds an option for 239 // TODO(crbug.com/653547): Remove this once the MDC adds an option for
240 // preventing the infobar from showing. 240 // preventing the infobar from showing.
241 - (void)updateFooterInfoBarIfNecessary { 241 - (void)updateFooterInfoBarIfNecessary {
242 // No-op. This prevents the default infobar from showing. 242 // No-op. This prevents the default infobar from showing.
243 } 243 }
244 244
245 #pragma mark - HistoryEntriesStatusItemDelegate 245 #pragma mark - HistoryEntriesStatusItemDelegate
246 246
247 - (void)historyEntriesStatusItem:(HistoryEntriesStatusItem*)item 247 - (void)historyEntriesStatusItem:(HistoryEntriesStatusItem*)item
248 didRequestOpenURL:(const GURL&)URL { 248 didRequestOpenURL:(const GURL&)URL {
249 [self openURL:URL]; 249 [self openURLInNewTab:URL];
250 } 250 }
251 251
252 #pragma mark - HistoryEntryInserterDelegate 252 #pragma mark - HistoryEntryInserterDelegate
253 253
254 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter 254 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter
255 didInsertItemAtIndexPath:(NSIndexPath*)indexPath { 255 didInsertItemAtIndexPath:(NSIndexPath*)indexPath {
256 [self.collectionView insertItemsAtIndexPaths:@[ indexPath ]]; 256 [self.collectionView insertItemsAtIndexPaths:@[ indexPath ]];
257 } 257 }
258 258
259 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter 259 - (void)historyEntryInserter:(HistoryEntryInserter*)inserter
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 NSData* plainText = [base::SysUTF8ToNSString(URL.spec()) 804 NSData* plainText = [base::SysUTF8ToNSString(URL.spec())
805 dataUsingEncoding:NSUTF8StringEncoding]; 805 dataUsingEncoding:NSUTF8StringEncoding];
806 NSDictionary* copiedItem = @{ 806 NSDictionary* copiedItem = @{
807 (NSString*)kUTTypeURL : net::NSURLWithGURL(URL), 807 (NSString*)kUTTypeURL : net::NSURLWithGURL(URL),
808 (NSString*)kUTTypeUTF8PlainText : plainText, 808 (NSString*)kUTTypeUTF8PlainText : plainText,
809 }; 809 };
810 [[UIPasteboard generalPasteboard] setItems:@[ copiedItem ]]; 810 [[UIPasteboard generalPasteboard] setItems:@[ copiedItem ]];
811 } 811 }
812 812
813 @end 813 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698