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

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

Issue 2655253002: Revert of Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 3 years, 11 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>
11 #include <vector> 11 #include <vector>
12 12
13 #import "base/mac/scoped_nsobject.h" 13 #import "base/mac/scoped_nsobject.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #import "ios/web/public/navigation_manager.h" 15 #import "ios/web/public/navigation_manager.h"
16 #include "ui/base/page_transition_types.h" 16 #include "ui/base/page_transition_types.h"
17 #include "url/gurl.h" 17 #include "url/gurl.h"
18 18
19 @class CRWSessionController; 19 @class CRWSessionController;
20 20
21 namespace web { 21 namespace web {
22 class BrowserState; 22 class BrowserState;
23 class NavigationItem; 23 class NavigationItem;
24 struct Referrer; 24 struct Referrer;
25 class NavigationManagerDelegate; 25 class NavigationManagerDelegate;
26 class NavigationManagerFacadeDelegate; 26 class NavigationManagerFacadeDelegate;
27 class NavigationManagerStorageBuilder;
28 27
29 // Implementation of NavigationManager. 28 // Implementation of NavigationManager.
30 // Generally mirrors upstream's NavigationController. 29 // Generally mirrors upstream's NavigationController.
31 class NavigationManagerImpl : public NavigationManager { 30 class NavigationManagerImpl : public NavigationManager {
32 public: 31 public:
33 NavigationManagerImpl(); 32 NavigationManagerImpl(NavigationManagerDelegate* delegate,
33 BrowserState* browser_state);
34 ~NavigationManagerImpl() override; 34 ~NavigationManagerImpl() override;
35 35
36 // Setters for NavigationManagerDelegate and BrowserState.
37 void SetDelegate(NavigationManagerDelegate* delegate);
38 void SetBrowserState(BrowserState* browser_state);
39
40 // Sets the CRWSessionController that backs this object. 36 // Sets the CRWSessionController that backs this object.
41 // Keeps a strong reference to |session_controller|. 37 // Keeps a strong reference to |session_controller|.
42 // This method should only be called when deserializing |session_controller| 38 // This method should only be called when deserializing |session_controller|
43 // and joining it with its NavigationManager. Other cases should call 39 // and joining it with its NavigationManager. Other cases should call
44 // InitializeSession() or ReplaceSessionHistory(). 40 // InitializeSession() or ReplaceSessionHistory().
45 // TODO(stuartmorgan): Also move deserialization of CRWSessionControllers 41 // TODO(stuartmorgan): Also move deserialization of CRWSessionControllers
46 // under the control of this class, and move the bulk of CRWSessionController 42 // under the control of this class, and move the bulk of CRWSessionController
47 // logic into it. 43 // logic into it.
48 void SetSessionController(CRWSessionController* session_controller); 44 void SetSessionController(CRWSessionController* session_controller);
49 45
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void CopyState(NavigationManagerImpl* navigation_manager); 131 void CopyState(NavigationManagerImpl* navigation_manager);
136 132
137 // Returns the navigation index that differs from the current item (or pending 133 // Returns the navigation index that differs from the current item (or pending
138 // item if it exists) by the specified |offset|, skipping redirect navigation 134 // item if it exists) by the specified |offset|, skipping redirect navigation
139 // items. The index returned is not guaranteed to be valid. 135 // items. The index returned is not guaranteed to be valid.
140 // TODO(crbug.com/661316): Make this method private once navigation code is 136 // TODO(crbug.com/661316): Make this method private once navigation code is
141 // moved from CRWWebController to NavigationManagerImpl. 137 // moved from CRWWebController to NavigationManagerImpl.
142 int GetIndexForOffset(int offset) const; 138 int GetIndexForOffset(int offset) const;
143 139
144 private: 140 private:
145 // The NavigationManagerStorageBuilder functions require access to
146 // private variables of NavigationManagerImpl.
147 friend NavigationManagerStorageBuilder;
148
149 // Returns true if the PageTransition for the underlying navigation item at 141 // Returns true if the PageTransition for the underlying navigation item at
150 // |index| has ui::PAGE_TRANSITION_IS_REDIRECT_MASK. 142 // |index| has ui::PAGE_TRANSITION_IS_REDIRECT_MASK.
151 bool IsRedirectItemAtIndex(int index) const; 143 bool IsRedirectItemAtIndex(int index) const;
152 144
153 // The primary delegate for this manager. 145 // The primary delegate for this manager.
154 NavigationManagerDelegate* delegate_; 146 NavigationManagerDelegate* delegate_;
155 147
156 // The BrowserState that is associated with this instance. 148 // The BrowserState that is associated with this instance.
157 BrowserState* browser_state_; 149 BrowserState* browser_state_;
158 150
159 // CRWSessionController that backs this instance. 151 // CRWSessionController that backs this instance.
160 // TODO(stuartmorgan): Fold CRWSessionController into this class. 152 // TODO(stuartmorgan): Fold CRWSessionController into this class.
161 base::scoped_nsobject<CRWSessionController> session_controller_; 153 base::scoped_nsobject<CRWSessionController> session_controller_;
162 154
163 // Weak pointer to the facade delegate. 155 // Weak pointer to the facade delegate.
164 NavigationManagerFacadeDelegate* facade_delegate_; 156 NavigationManagerFacadeDelegate* facade_delegate_;
165 157
166 // List of transient url rewriters added by |AddTransientURLRewriter()|. 158 // List of transient url rewriters added by |AddTransientURLRewriter()|.
167 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>> 159 std::unique_ptr<std::vector<BrowserURLRewriter::URLRewriter>>
168 transient_url_rewriters_; 160 transient_url_rewriters_;
169 161
170 DISALLOW_COPY_AND_ASSIGN(NavigationManagerImpl); 162 DISALLOW_COPY_AND_ASSIGN(NavigationManagerImpl);
171 }; 163 };
172 164
173 } // namespace web 165 } // namespace web
174 166
175 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ 167 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_
OLDNEW
« no previous file with comments | « ios/web/navigation/crw_session_controller.mm ('k') | ios/web/navigation/navigation_manager_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698