Chromium Code Reviews| 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..2d3823c848b78dc7b714f91ed3fa8c5d2b83c11b 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,9 +348,9 @@ 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; |
| +//// Opens a link in an external app. Returns YES iff |url| is launched in an |
| +//// external app. |
|
jif
2017/03/30 09:05:56
s/////////
Olivier
2017/03/30 15:45:04
This is removed
|
| +//- (BOOL)openExternalURL:(const GURL&)url linkClicked:(BOOL)linkClicked; |
|
Eugene But (OOO till 7-30)
2017/03/29 19:56:13
Looks like this is redefinition of CRWWebDelegate
Olivier
2017/03/30 15:45:04
Done.
|
| // Handles exportable files if possible. |
| - (void)handleExportableFile:(net::HttpResponseHeaders*)headers; |
| @@ -1264,7 +1265,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,11 +1314,23 @@ 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; |
| } |
| +- (void)currentNavigationWillContinueInExternalApp { |
|
Eugene But (OOO till 7-30)
2017/03/29 19:56:13
I guess you don't need this anymore
Olivier
2017/03/30 15:45:03
Done.
|
| +} |
| + |
| - (void)webState:(web::WebState*)webState |
| didFinishNavigation:(web::NavigationContext*)navigation { |
| if (navigation->IsSameDocument()) { |
| @@ -1746,6 +1761,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; |
| } |