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

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

Issue 2672953005: Updated ownership of NavigationItems within CRWSessionController. (Closed)
Patch Set: fix unittests 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
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/navigation/crw_session_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "ios/web/public/navigation_item_list.h" 11 #import "ios/web/navigation/navigation_item_impl_list.h"
12 #include "ui/base/page_transition_types.h" 12 #include "ui/base/page_transition_types.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 @class CRWSessionEntry; 15 @class CRWSessionEntry;
16 @class CRWSessionCertificatePolicyManager; 16 @class CRWSessionCertificatePolicyManager;
17 17
18 namespace web { 18 namespace web {
19 class BrowserState; 19 class BrowserState;
20 class NavigationItemImpl; 20 class NavigationItemImpl;
21 class NavigationManagerImpl; 21 class NavigationManagerImpl;
(...skipping 17 matching lines...) Expand all
39 @property(nonatomic, copy) NSString* windowName; 39 @property(nonatomic, copy) NSString* windowName;
40 // Indicates whether the page was opened by DOM (e.g. with |window.open| 40 // Indicates whether the page was opened by DOM (e.g. with |window.open|
41 // JavaScript call or by clicking a link with |_blank| target). 41 // JavaScript call or by clicking a link with |_blank| target).
42 @property(nonatomic, readonly, getter=isOpenedByDOM) BOOL openedByDOM; 42 @property(nonatomic, readonly, getter=isOpenedByDOM) BOOL openedByDOM;
43 @property(nonatomic, readonly, strong) 43 @property(nonatomic, readonly, strong)
44 CRWSessionCertificatePolicyManager* sessionCertificatePolicyManager; 44 CRWSessionCertificatePolicyManager* sessionCertificatePolicyManager;
45 @property(nonatomic, assign) NSTimeInterval lastVisitedTimestamp; 45 @property(nonatomic, assign) NSTimeInterval lastVisitedTimestamp;
46 @property(nonatomic, readonly, copy) NSString* openerId; 46 @property(nonatomic, readonly, copy) NSString* openerId;
47 @property(nonatomic, readonly, assign) NSInteger openerNavigationIndex; 47 @property(nonatomic, readonly, assign) NSInteger openerNavigationIndex;
48 48
49 // The list of CRWSessionEntries in |_entries|'s NavigationItemImpls. 49 // The ScopedNavigationItemImplList used to store the NavigationItemImpls for
50 @property(nonatomic, readonly) web::NavigationItemList items; 50 // this session.
51 @property(nonatomic, readonly) const web::ScopedNavigationItemImplList& items;
51 // The current NavigationItem. During a pending navigation, returns the 52 // The current NavigationItem. During a pending navigation, returns the
52 // NavigationItem for that navigation. If a transient NavigationItem exists, 53 // NavigationItem for that navigation. If a transient NavigationItem exists,
53 // this NavigationItem will be returned. 54 // this NavigationItem will be returned.
54 @property(nonatomic, readonly) web::NavigationItemImpl* currentItem; 55 @property(nonatomic, readonly) web::NavigationItemImpl* currentItem;
55 // Returns the NavigationItem whose URL should be displayed to the user. 56 // Returns the NavigationItem whose URL should be displayed to the user.
56 @property(nonatomic, readonly) web::NavigationItemImpl* visibleItem; 57 @property(nonatomic, readonly) web::NavigationItemImpl* visibleItem;
57 // Returns the NavigationItem corresponding to a load for which no data has yet 58 // Returns the NavigationItem corresponding to a load for which no data has yet
58 // been received. 59 // been received.
59 @property(nonatomic, readonly) web::NavigationItemImpl* pendingItem; 60 @property(nonatomic, readonly) web::NavigationItemImpl* pendingItem;
60 // Returns the NavigationItem corresponding with a transient navigation (i.e. 61 // Returns the NavigationItem corresponding with a transient navigation (i.e.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 transition:(ui::PageTransition)transition; 130 transition:(ui::PageTransition)transition;
130 131
131 // Updates the URL and state object for the current item. 132 // Updates the URL and state object for the current item.
132 - (void)updateCurrentItemWithURL:(const GURL&)url 133 - (void)updateCurrentItemWithURL:(const GURL&)url
133 stateObject:(NSString*)stateObject; 134 stateObject:(NSString*)stateObject;
134 135
135 // Removes the pending and transient NavigationItems. 136 // Removes the pending and transient NavigationItems.
136 - (void)discardNonCommittedItems; 137 - (void)discardNonCommittedItems;
137 138
138 // Inserts history state from |otherController| to the front of |items|. This 139 // Inserts history state from |otherController| to the front of |items|. This
139 // function transfers ownership of |otherController|'s NavigationItems to the 140 // function will create copies of |otherController|'s NavigationItems.
140 // receiver.
141 - (void)insertStateFromSessionController:(CRWSessionController*)otherController; 141 - (void)insertStateFromSessionController:(CRWSessionController*)otherController;
142 142
143 // Sets |currentNavigationIndex_| to the |index| if it's in the entries bounds. 143 // Sets |currentNavigationIndex_| to the |index| if it's in the entries bounds.
144 - (void)goToItemAtIndex:(NSInteger)index; 144 - (void)goToItemAtIndex:(NSInteger)index;
145 145
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 156 // Set |useDesktopUserAgentForNextPendingItem_| to YES if there is no pending
157 // entry, otherwise set |useDesktopUserAgent| in the pending entry. 157 // entry, otherwise set |useDesktopUserAgent| in the pending entry.
158 - (void)useDesktopUserAgentForNextPendingItem; 158 - (void)useDesktopUserAgentForNextPendingItem;
159 159
160 // Returns the index of |item| in |items|. 160 // Returns the index of |item| in |items|.
161 - (NSInteger)indexOfItem:(web::NavigationItem*)item; 161 - (NSInteger)indexOfItem:(web::NavigationItem*)item;
162 162
163 @end 163 @end
164 164
165 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_ 165 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/navigation/crw_session_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698