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

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

Issue 2698773002: [iOS] Refactoring web CRWSessionController user agent code. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_CRW_SESSION_CONTROLLER_H_ 5 #ifndef IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_
6 #define IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ 6 #define IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // CRWSessionController doesn't have public constructors. New 90 // CRWSessionController doesn't have public constructors. New
91 // CRWSessionControllers are created by deserialization, or via a 91 // CRWSessionControllers are created by deserialization, or via a
92 // NavigationManager. 92 // NavigationManager.
93 93
94 // Sets the corresponding NavigationManager. 94 // Sets the corresponding NavigationManager.
95 - (void)setNavigationManager:(web::NavigationManagerImpl*)navigationManager; 95 - (void)setNavigationManager:(web::NavigationManagerImpl*)navigationManager;
96 // Sets the corresponding BrowserState. 96 // Sets the corresponding BrowserState.
97 - (void)setBrowserState:(web::BrowserState*)browserState; 97 - (void)setBrowserState:(web::BrowserState*)browserState;
98 98
99 // Add a new item with the given url, referrer, and navigation type, making it 99 // Add a new item with the given url, referrer, and navigation type, making it
100 // the current item. If |url| is the same as the current item's url, this 100 // the current item. If pending item is the same as current item, this does
101 // does nothing. |referrer| may be nil if there isn't one. The item starts 101 // nothing. |referrer| may be nil if there isn't one. The item starts out as
102 // out as pending, and will be lost unless |-commitPendingItem| is called. 102 // pending, and will be lost unless |-commitPendingItem| is called.
kkhorimoto 2017/02/15 23:02:05 I think the original comment is less ambiguous her
liaoyuke 2017/02/16 01:49:04 But the implementation details is not consistent w
103 - (void)addPendingItem:(const GURL&)url 103 - (void)addPendingItem:(const GURL&)url
104 referrer:(const web::Referrer&)referrer 104 referrer:(const web::Referrer&)referrer
105 transition:(ui::PageTransition)type 105 transition:(ui::PageTransition)type
106 rendererInitiated:(BOOL)rendererInitiated; 106 rendererInitiated:(BOOL)rendererInitiated;
107 107
108 // Updates the URL of the yet to be committed pending item. Useful for page 108 // Updates the URL of the yet to be committed pending item. Useful for page
109 // redirects. Does nothing if there is no pending item. 109 // redirects. Does nothing if there is no pending item.
110 - (void)updatePendingItem:(const GURL&)url; 110 - (void)updatePendingItem:(const GURL&)url;
111 111
112 // Commits the current pending item. No changes are made to the item during 112 // Commits the current pending item. No changes are made to the item during
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // Removes the item at |index| after discarding any noncomitted entries. 146 // Removes the item at |index| after discarding any noncomitted entries.
147 // |index| must not be the index of the last committed item, or a noncomitted 147 // |index| must not be the index of the last committed item, or a noncomitted
148 // item. 148 // item.
149 - (void)removeItemAtIndex:(NSInteger)index; 149 - (void)removeItemAtIndex:(NSInteger)index;
150 150
151 // Determines whether a navigation between |firstEntry| and |secondEntry| is a 151 // Determines whether a navigation between |firstEntry| and |secondEntry| is a
152 // same-document navigation. Entries can be passed in any order. 152 // same-document navigation. Entries can be passed in any order.
153 - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem 153 - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem
154 andItem:(web::NavigationItem*)secondItem; 154 andItem:(web::NavigationItem*)secondItem;
155 155
156 // Set |useDesktopUserAgentForNextPendingItem_| to YES if there is no pending
157 // entry, otherwise set |useDesktopUserAgent| in the pending entry.
158 - (void)useDesktopUserAgentForNextPendingItem;
159
160 // Returns the index of |item| in |items|. 156 // Returns the index of |item| in |items|.
161 - (NSInteger)indexOfItem:(const web::NavigationItem*)item; 157 - (NSInteger)indexOfItem:(const web::NavigationItem*)item;
162 158
163 @end 159 @end
164 160
165 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ 161 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698