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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2723683002: Test URL instead of VirtualURL in [BVC isTabNativePage] (Closed)
Patch Set: comment Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index ce801b2a0b180c506ab375c346400001879bc801..435b2c7241ce7ab76f320dea08fcd3b2e6025fa2 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -625,7 +625,7 @@ FindInPageController* GetFindInPageController(Tab* tab) {
// Shows the source of the current page.
- (void)viewSource;
#endif
-// Whether the given tab's url begins with the chrome prefix.
+// Whether the given tab's URL is an application specific URL.
- (BOOL)isTabNativePage:(Tab*)tab;
// Returns the view to use when animating a page in or out, positioning it to
// fill the content area but not actually adding it to the view hierarchy.
@@ -2051,9 +2051,18 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
return tab;
}
-// Whether the given tab's url begins with the chrome prefix.
+// Whether the given tab's URL is an application specific URL.
- (BOOL)isTabNativePage:(Tab*)tab {
- return tab && tab.url.SchemeIs(kChromeUIScheme);
+ web::WebState* webState = tab.webState;
+ if (!webState)
+ return NO;
+ web::NavigationManager* navigationManager = webState->GetNavigationManager();
+ if (!navigationManager)
+ return NO;
+ web::NavigationItem* visibleItem = navigationManager->GetVisibleItem();
+ if (!visibleItem)
+ return NO;
+ return web::GetWebClient()->IsAppSpecificURL(visibleItem->GetURL());
}
- (void)expectNewForegroundTab {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698