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

Side by Side Diff: ios/web/navigation/navigation_manager_impl.h

Issue 2779383002: implement user agent override option. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ 5 #ifndef IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_
6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ 6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void OnNavigationItemCommitted(); 88 void OnNavigationItemCommitted();
89 89
90 // Temporary accessors and content/ class pass-throughs. 90 // Temporary accessors and content/ class pass-throughs.
91 // TODO(stuartmorgan): Re-evaluate this list once the refactorings have 91 // TODO(stuartmorgan): Re-evaluate this list once the refactorings have
92 // settled down. 92 // settled down.
93 CRWSessionController* GetSessionController(); 93 CRWSessionController* GetSessionController();
94 void LoadURL(const GURL& url, 94 void LoadURL(const GURL& url,
95 const Referrer& referrer, 95 const Referrer& referrer,
96 ui::PageTransition type); 96 ui::PageTransition type);
97 97
98 // Adds a new item with the given url, referrer, navigation type, and 98 // Adds a new item with the given url, referrer, navigation type, initiation
99 // initiation type, making it the pending item. If pending item is the same as 99 // type and user agent override option, making it the pending item. If pending
100 // the current item, this does nothing. |referrer| may be nil if there isn't 100 // item is the same as the current item, this does nothing. |referrer| may be
101 // one. The item starts out as pending, and will be lost unless 101 // nil if there isn't one. The item starts out as pending, and will be lost
102 // |-commitPendingItem| is called. 102 // unless |-commitPendingItem| is called.
103 void AddPendingItem(const GURL& url, 103 void AddPendingItem(const GURL& url,
104 const web::Referrer& referrer, 104 const web::Referrer& referrer,
105 ui::PageTransition navigation_type, 105 ui::PageTransition navigation_type,
106 NavigationInitiationType initiation_type); 106 NavigationInitiationType initiation_type,
107 UserAgentOverrideOption user_agent_override_option);
107 108
108 // Temporary method. Returns a vector of NavigationItems corresponding to 109 // Temporary method. Returns a vector of NavigationItems corresponding to
109 // the SessionEntries of the uderlying CRWSessionController. 110 // the SessionEntries of the uderlying CRWSessionController.
110 // TODO(crbug.com/546365): Remove this method. 111 // TODO(crbug.com/546365): Remove this method.
111 NavigationItemList GetItems() const; 112 NavigationItemList GetItems() const;
112 113
113 // NavigationManager: 114 // NavigationManager:
114 BrowserState* GetBrowserState() const override; 115 BrowserState* GetBrowserState() const override;
115 WebState* GetWebState() const override; 116 WebState* GetWebState() const override;
116 NavigationItem* GetVisibleItem() const override; 117 NavigationItem* GetVisibleItem() const override;
(...skipping 14 matching lines...) Expand all
131 bool CanGoForward() const override; 132 bool CanGoForward() const override;
132 bool CanGoToOffset(int offset) const override; 133 bool CanGoToOffset(int offset) const override;
133 void GoBack() override; 134 void GoBack() override;
134 void GoForward() override; 135 void GoForward() override;
135 void GoToIndex(int index) override; 136 void GoToIndex(int index) override;
136 void Reload(ReloadType reload_type, bool check_for_reposts) override; 137 void Reload(ReloadType reload_type, bool check_for_reposts) override;
137 NavigationItemList GetBackwardItems() const override; 138 NavigationItemList GetBackwardItems() const override;
138 NavigationItemList GetForwardItems() const override; 139 NavigationItemList GetForwardItems() const override;
139 void CopyStateFromAndPrune(const NavigationManager* source) override; 140 void CopyStateFromAndPrune(const NavigationManager* source) override;
140 bool CanPruneAllButLastCommittedItem() const override; 141 bool CanPruneAllButLastCommittedItem() const override;
141 void OverrideDesktopUserAgentForNextPendingItem() override;
142 142
143 // Returns the current list of transient url rewriters, passing ownership to 143 // Returns the current list of transient url rewriters, passing ownership to
144 // the caller. 144 // the caller.
145 // TODO(crbug.com/546197): remove once NavigationItem creation occurs in this 145 // TODO(crbug.com/546197): remove once NavigationItem creation occurs in this
146 // class. 146 // class.
147 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> 147 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>>
148 GetTransientURLRewriters(); 148 GetTransientURLRewriters();
149 149
150 // Called to reset the transient url rewriter list. 150 // Called to reset the transient url rewriter list.
151 void RemoveTransientURLRewriters(); 151 void RemoveTransientURLRewriters();
(...skipping 11 matching lines...) Expand all
163 friend SessionStorageBuilder; 163 friend SessionStorageBuilder;
164 164
165 // Returns true if the PageTransition for the underlying navigation item at 165 // Returns true if the PageTransition for the underlying navigation item at
166 // |index| has ui::PAGE_TRANSITION_IS_REDIRECT_MASK. 166 // |index| has ui::PAGE_TRANSITION_IS_REDIRECT_MASK.
167 bool IsRedirectItemAtIndex(int index) const; 167 bool IsRedirectItemAtIndex(int index) const;
168 168
169 // Returns the most recent NavigationItem that does not have an app-specific 169 // Returns the most recent NavigationItem that does not have an app-specific
170 // URL. 170 // URL.
171 NavigationItem* GetLastCommittedNonAppSpecificItem() const; 171 NavigationItem* GetLastCommittedNonAppSpecificItem() const;
172 172
173 // If true, override navigation item's useDesktopUserAgent flag and always
174 // create the pending entry using the desktop user agent.
175 // TODO(crbug.com/692303): Remove this when overriding the user agent doesn't
176 // create a new NavigationItem.
177 bool override_desktop_user_agent_for_next_pending_item_;
kkhorimoto 2017/03/30 02:30:28 Yay, I'm happy to see this go away :)
178
179 // The primary delegate for this manager. 173 // The primary delegate for this manager.
180 NavigationManagerDelegate* delegate_; 174 NavigationManagerDelegate* delegate_;
181 175
182 // The BrowserState that is associated with this instance. 176 // The BrowserState that is associated with this instance.
183 BrowserState* browser_state_; 177 BrowserState* browser_state_;
184 178
185 // CRWSessionController that backs this instance. 179 // CRWSessionController that backs this instance.
186 // TODO(stuartmorgan): Fold CRWSessionController into this class. 180 // TODO(stuartmorgan): Fold CRWSessionController into this class.
187 base::scoped_nsobject<CRWSessionController> session_controller_; 181 base::scoped_nsobject<CRWSessionController> session_controller_;
188 182
189 // Weak pointer to the facade delegate. 183 // Weak pointer to the facade delegate.
190 NavigationManagerFacadeDelegate* facade_delegate_; 184 NavigationManagerFacadeDelegate* facade_delegate_;
191 185
192 // List of transient url rewriters added by |AddTransientURLRewriter()|. 186 // List of transient url rewriters added by |AddTransientURLRewriter()|.
193 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> 187 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>>
194 transient_url_rewriters_; 188 transient_url_rewriters_;
195 189
196 DISALLOW_COPY_AND_ASSIGN(NavigationManagerImpl); 190 DISALLOW_COPY_AND_ASSIGN(NavigationManagerImpl);
197 }; 191 };
198 192
199 } // namespace web 193 } // namespace web
200 194
201 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ 195 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698