Chromium Code Reviews| Index: ios/web/navigation/navigation_manager_impl.h |
| diff --git a/ios/web/navigation/navigation_manager_impl.h b/ios/web/navigation/navigation_manager_impl.h |
| index cf1b29562b7eca3487604784d65e6a613354ca0e..aea819392490ae638d10422210a5a372cdf69795 100644 |
| --- a/ios/web/navigation/navigation_manager_impl.h |
| +++ b/ios/web/navigation/navigation_manager_impl.h |
| @@ -26,6 +26,14 @@ class NavigationManagerDelegate; |
| class NavigationManagerFacadeDelegate; |
| class SessionStorageBuilder; |
| +// |USER_INITIATED| represents pending item that is initiated by actual user |
|
Eugene But (OOO till 7-30)
2017/02/17 00:00:23
Please move comment for enum values and place them
liaoyuke
2017/02/17 01:16:51
Thank you for the detailed explanation!
Eugene But (OOO till 7-30)
2017/02/17 01:21:11
Per my previous comment, please add comments for e
liaoyuke
2017/02/17 01:32:59
Done.
|
| +// actions, while |RENDERER_INITIATED| stands for pending item that is initiated |
| +// by Url redirect from another navigation item. |
| +enum class ItemInitiationType { |
| + USER_INITIATED = 1, |
| + RENDERER_INITIATED = 2, |
| +}; |
| + |
| // Implementation of NavigationManager. |
| // Generally mirrors upstream's NavigationController. |
| class NavigationManagerImpl : public NavigationManager { |
| @@ -82,6 +90,16 @@ class NavigationManagerImpl : public NavigationManager { |
| const Referrer& referrer, |
| ui::PageTransition type); |
| + // Adds a new item with the given url, referrer, navigation type, pending item |
| + // type, making it the current item. If pending item is the same as the |
|
Eugene But (OOO till 7-30)
2017/02/17 00:00:23
s/current/pending
liaoyuke
2017/02/17 01:16:51
Done.
|
| + // current item, this does nothing. |referrer| may be nil if there isn't one. |
| + // The item starts out as pending, and will be lost unless |
| + // |-commitPendingItem| is called. |
| + void AddPendingItem(const GURL& url, |
| + const web::Referrer& referrer, |
| + ui::PageTransition navigation_type, |
| + ItemInitiationType initiation_type); |
| + |
| // Convenience accessors to get the underlying NavigationItems from the |
| // SessionEntries returned from |session_controller_|'s -lastUserEntry and |
| // -previousEntry methods. |
| @@ -119,6 +137,7 @@ class NavigationManagerImpl : public NavigationManager { |
| void GoForward() override; |
| void GoToIndex(int index) override; |
| void Reload(bool check_for_reposts) override; |
| + void OverrideDesktopUserAgentForNextPendingItem() override; |
| // Returns the current list of transient url rewriters, passing ownership to |
| // the caller. |
| @@ -150,6 +169,12 @@ class NavigationManagerImpl : public NavigationManager { |
| // |index| has ui::PAGE_TRANSITION_IS_REDIRECT_MASK. |
| bool IsRedirectItemAtIndex(int index) const; |
| + // If true, override navigation item's useDesktopUserAgent flag and always |
| + // create the pending entry using the desktop user agent. |
| + // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't |
| + // create a new NavigationItem. |
| + bool override_desktop_user_agent_for_next_pending_item_; |
| + |
| // The primary delegate for this manager. |
| NavigationManagerDelegate* delegate_; |