OLD | NEW |
| (Empty) |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ios/chrome/browser/native_app_launcher/native_app_navigation_util.h" | |
6 | |
7 #import "ios/chrome/browser/web/navigation_manager_util.h" | |
8 #import "ios/web/public/navigation_item.h" | |
9 #import "ios/web/public/web_state/web_state.h" | |
10 | |
11 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
12 #error "This file requires ARC support." | |
13 #endif | |
14 | |
15 namespace native_app_launcher { | |
16 | |
17 bool IsLinkNavigation(web::WebState* web_state) { | |
18 DCHECK(web_state); | |
19 web::NavigationItem* item = | |
20 GetLastCommittedNonRedirectedItem(web_state->GetNavigationManager()); | |
21 if (!item) | |
22 return false; | |
23 ui::PageTransition transition = item->GetTransitionType(); | |
24 return PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_LINK) || | |
25 PageTransitionCoreTypeIs(transition, | |
26 ui::PAGE_TRANSITION_AUTO_BOOKMARK); | |
27 } | |
28 | |
29 } // namespace native_app_launcher | |
OLD | NEW |