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

Unified Diff: ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm

Issue 2745563002: Add Open in New Tab method for Reading List Delegate (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm
index 1dcd04a162d44cac272f0236b9cf1ee77b2fc6f4..6044569c864a992c06a77d635a3c3a8e532af30b 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm
@@ -57,21 +57,6 @@ enum UMAContextMenuAction {
@property(nonatomic, strong) ReadingListViewController* containerViewController;
@property(nonatomic, strong) AlertCoordinator* alertCoordinator;
-// Opens |URL| in a new tab |incognito| or not.
-- (void)openNewTabWithURL:(const GURL&)URL
- incognito:(BOOL)incognito
- fromReadingListCollectionViewController:
- (ReadingListCollectionViewController*)
- readingListCollectionViewController;
-
-// Opens the offline url |offlineURL| of the entry saved in the reading list
-// model with the |entryURL| url.
-- (void)openOfflineURL:(const GURL&)offlineURL
- correspondingEntryURL:(const GURL&)entryURL
- fromReadingListCollectionViewController:
- (ReadingListCollectionViewController*)
- readingListCollectionViewController;
-
@end
@implementation ReadingListCoordinator
@@ -180,9 +165,9 @@ enum UMAContextMenuAction {
[_alertCoordinator
addItemWithTitle:openInNewTabTitle
action:^{
- [weakSelf openNewTabWithURL:entryURL
- incognito:NO
- fromReadingListCollectionViewController:weakCollection];
+ [weakSelf readingListCollectionViewController:weakCollection
+ openNewTabWithURL:entryURL
+ incognito:NO];
UMA_HISTOGRAM_ENUMERATION("ReadingList.ContextMenu", NEW_TAB,
ENUM_MAX);
@@ -194,9 +179,9 @@ enum UMAContextMenuAction {
[_alertCoordinator
addItemWithTitle:openInNewTabIncognitoTitle
action:^{
- [weakSelf openNewTabWithURL:entryURL
- incognito:YES
- fromReadingListCollectionViewController:weakCollection];
+ [weakSelf readingListCollectionViewController:weakCollection
+ openNewTabWithURL:entryURL
+ incognito:YES];
UMA_HISTOGRAM_ENUMERATION("ReadingList.ContextMenu",
NEW_INCOGNITO_TAB, ENUM_MAX);
}
@@ -223,9 +208,9 @@ enum UMAContextMenuAction {
action:^{
UMA_HISTOGRAM_ENUMERATION("ReadingList.ContextMenu",
VIEW_OFFLINE, ENUM_MAX);
- [weakSelf openOfflineURL:offlineURL
- correspondingEntryURL:entryURL
- fromReadingListCollectionViewController:weakCollection];
+ [weakSelf readingListCollectionViewController:weakCollection
+ openOfflineURL:offlineURL
+ correspondingEntryURL:entryURL];
}
style:UIAlertActionStyleDefault];
}
@@ -267,17 +252,14 @@ readingListCollectionViewController:
[self stop];
}
-#pragma mark - Private
-
-- (void)openOfflineURL:(const GURL&)offlineURL
- correspondingEntryURL:(const GURL&)entryURL
- fromReadingListCollectionViewController:
- (ReadingListCollectionViewController*)
- readingListCollectionViewController {
- [self openNewTabWithURL:offlineURL
- incognito:NO
- fromReadingListCollectionViewController:
- readingListCollectionViewController];
+- (void)readingListCollectionViewController:
+ (ReadingListCollectionViewController*)
+ readingListCollectionViewController
+ openOfflineURL:(const GURL&)offlineURL
+ correspondingEntryURL:(const GURL&)entryURL {
+ [self readingListCollectionViewController:readingListCollectionViewController
+ openNewTabWithURL:offlineURL
+ incognito:NO];
UMA_HISTOGRAM_BOOLEAN("ReadingList.OfflineVersionDisplayed", true);
const GURL updateURL = entryURL;
@@ -285,11 +267,11 @@ readingListCollectionViewController:
true);
}
-- (void)openNewTabWithURL:(const GURL&)URL
- incognito:(BOOL)incognito
- fromReadingListCollectionViewController:
- (ReadingListCollectionViewController*)
- readingListCollectionViewController {
+- (void)readingListCollectionViewController:
+ (ReadingListCollectionViewController*)
+ readingListCollectionViewController
+ openNewTabWithURL:(const GURL&)URL
+ incognito:(BOOL)incognito {
base::RecordAction(base::UserMetricsAction("MobileReadingListOpen"));
[readingListCollectionViewController willBeDismissed];
« no previous file with comments | « ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698