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

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2784843002: Reading List: Mark entry read when opening external app. (Closed)
Patch Set: feedback 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 | « no previous file | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index b5e12d3765c2add415dff86d912e2a3beaf136a6..cd2f4f1a21ea37083e6014cdba9269040f92bf3c 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -68,6 +68,7 @@
#import "ios/chrome/browser/passwords/password_controller.h"
#import "ios/chrome/browser/passwords/passwords_ui_delegate_impl.h"
#include "ios/chrome/browser/pref_names.h"
+#include "ios/chrome/browser/reading_list/reading_list_model_factory.h"
#include "ios/chrome/browser/search_engines/template_url_service_factory.h"
#include "ios/chrome/browser/sessions/ios_chrome_session_tab_helper.h"
#include "ios/chrome/browser/signin/account_consistency_service_factory.h"
@@ -347,10 +348,6 @@ enum class RendererTerminationTabState {
// Initialize the Native App Launcher controller.
- (void)initNativeAppNavigationController;
-// Opens a link in an external app. Returns YES iff |url| is launched in an
-// external app.
-- (BOOL)openExternalURL:(const GURL&)url linkClicked:(BOOL)linkClicked;
-
// Handles exportable files if possible.
- (void)handleExportableFile:(net::HttpResponseHeaders*)headers;
@@ -1264,7 +1261,9 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
}
}
-- (BOOL)openExternalURL:(const GURL&)url linkClicked:(BOOL)linkClicked {
+- (BOOL)openExternalURL:(const GURL&)url
+ sourceURL:(const GURL&)sourceURL
+ linkClicked:(BOOL)linkClicked {
if (!externalAppLauncher_.get())
externalAppLauncher_.reset([[ExternalAppLauncher alloc] init]);
@@ -1311,6 +1310,15 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
// Ensure the UI reflects the current entry, not the just-discarded pending
// entry.
[parentTabModel_ notifyTabChanged:self];
+
+ if (sourceURL.is_valid()) {
+ ReadingListModel* model =
+ ReadingListModelFactory::GetForBrowserState(browserState_);
+ if (model && model->loaded()) {
+ model->SetReadStatus(sourceURL, true);
+ }
+ }
+
return YES;
}
return NO;
@@ -1746,6 +1754,7 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
// Attempts to open external app without x-callback.
if ([self openExternalURL:[metadata launchURLWithURL:url identity:identity]
+ sourceURL:sourceURL
linkClicked:linkClicked]) {
return YES;
}
« no previous file with comments | « no previous file | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698