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

Side by Side Diff: ios/web/web_state/web_state_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, 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/public/web_state/web_state.h ('k') | ios/web/web_state/web_state_impl.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 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_WEB_STATE_WEB_STATE_IMPL_H_ 5 #ifndef IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ 6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/observer_list.h" 18 #include "base/observer_list.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #import "ios/web/navigation/navigation_manager_delegate.h" 20 #import "ios/web/navigation/navigation_manager_delegate.h"
21 #import "ios/web/navigation/navigation_manager_impl.h" 21 #import "ios/web/navigation/navigation_manager_impl.h"
22 #import "ios/web/public/java_script_dialog_callback.h" 22 #import "ios/web/public/java_script_dialog_callback.h"
23 #include "ios/web/public/java_script_dialog_type.h" 23 #include "ios/web/public/java_script_dialog_type.h"
24 #import "ios/web/public/web_state/web_state.h" 24 #import "ios/web/public/web_state/web_state.h"
25 #import "ios/web/public/web_state/web_state_delegate.h" 25 #import "ios/web/public/web_state/web_state_delegate.h"
26 #include "url/gurl.h" 26 #include "url/gurl.h"
27 27
28 @class CRWNavigationManagerStorage;
29 @class CRWWebController; 28 @class CRWWebController;
30 @protocol CRWWebViewProxy; 29 @protocol CRWWebViewProxy;
31 @class NSURLRequest; 30 @class NSURLRequest;
32 @class NSURLResponse; 31 @class NSURLResponse;
33 32
34 namespace net { 33 namespace net {
35 class HttpResponseHeaders; 34 class HttpResponseHeaders;
36 } 35 }
37 36
38 namespace web { 37 namespace web {
(...skipping 17 matching lines...) Expand all
56 // (a) By @Tab, when creating a new Tab. 55 // (a) By @Tab, when creating a new Tab.
57 // (b) By @SessionWindow, when decoding a saved session. 56 // (b) By @SessionWindow, when decoding a saved session.
58 // (c) By the Copy() method, below, used when marshalling a session 57 // (c) By the Copy() method, below, used when marshalling a session
59 // in preparation for saving. 58 // in preparation for saving.
60 // - WebControllers are the eventual long-term owners of WebStateImpls. 59 // - WebControllers are the eventual long-term owners of WebStateImpls.
61 // - SessionWindows are transient owners, passing ownership into WebControllers 60 // - SessionWindows are transient owners, passing ownership into WebControllers
62 // during session restore, and discarding owned copies of WebStateImpls after 61 // during session restore, and discarding owned copies of WebStateImpls after
63 // writing them out for session saves. 62 // writing them out for session saves.
64 class WebStateImpl : public WebState, public NavigationManagerDelegate { 63 class WebStateImpl : public WebState, public NavigationManagerDelegate {
65 public: 64 public:
66 // Constructor for WebStateImpls created for new sessions.
67 WebStateImpl(BrowserState* browser_state); 65 WebStateImpl(BrowserState* browser_state);
68 // Constructor for WebStatesImpls created for deserialized sessions
69 WebStateImpl(BrowserState* browser_state,
70 CRWNavigationManagerStorage* session_storage);
71 ~WebStateImpl() override; 66 ~WebStateImpl() override;
72 67
73 // Gets/Sets the CRWWebController that backs this object. 68 // Gets/Sets the CRWWebController that backs this object.
74 CRWWebController* GetWebController(); 69 CRWWebController* GetWebController();
75 void SetWebController(CRWWebController* web_controller); 70 void SetWebController(CRWWebController* web_controller);
76 71
77 // Gets or sets the delegate used to communicate with the web contents facade. 72 // Gets or sets the delegate used to communicate with the web contents facade.
78 WebStateFacadeDelegate* GetFacadeDelegate() const; 73 WebStateFacadeDelegate* GetFacadeDelegate() const;
79 void SetFacadeDelegate(WebStateFacadeDelegate* facade_delegate); 74 void SetFacadeDelegate(WebStateFacadeDelegate* facade_delegate);
80 75
76 // Returns a WebStateImpl that doesn't have a browser context, web
77 // controller, or facade set, but which otherwise has the same state variables
78 // as the calling object (including copies of the NavigationManager and its
79 // attendant CRWSessionController).
80 // TODO(crbug.com/546377): Clean up this method.
81 WebStateImpl* CopyForSessionWindow();
82
81 // Notifies the observers that a provisional navigation has started. 83 // Notifies the observers that a provisional navigation has started.
82 void OnProvisionalNavigationStarted(const GURL& url); 84 void OnProvisionalNavigationStarted(const GURL& url);
83 85
84 // Called when a navigation is committed. 86 // Called when a navigation is committed.
85 void OnNavigationCommitted(const GURL& url); 87 void OnNavigationCommitted(const GURL& url);
86 88
87 // Notifies the observers that the URL hash of the current page changed. 89 // Notifies the observers that the URL hash of the current page changed.
88 void OnUrlHashChanged(); 90 void OnUrlHashChanged();
89 91
90 // Notifies the observers that the history state of the current page changed. 92 // Notifies the observers that the history state of the current page changed.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 bool IsWebUsageEnabled() const override; 199 bool IsWebUsageEnabled() const override;
198 void SetWebUsageEnabled(bool enabled) override; 200 void SetWebUsageEnabled(bool enabled) override;
199 bool ShouldSuppressDialogs() const override; 201 bool ShouldSuppressDialogs() const override;
200 void SetShouldSuppressDialogs(bool should_suppress) override; 202 void SetShouldSuppressDialogs(bool should_suppress) override;
201 UIView* GetView() override; 203 UIView* GetView() override;
202 BrowserState* GetBrowserState() const override; 204 BrowserState* GetBrowserState() const override;
203 void OpenURL(const WebState::OpenURLParams& params) override; 205 void OpenURL(const WebState::OpenURLParams& params) override;
204 void Stop() override; 206 void Stop() override;
205 const NavigationManager* GetNavigationManager() const override; 207 const NavigationManager* GetNavigationManager() const override;
206 NavigationManager* GetNavigationManager() override; 208 NavigationManager* GetNavigationManager() override;
207 CRWNavigationManagerStorage* BuildSerializedNavigationManager() override;
208 CRWJSInjectionReceiver* GetJSInjectionReceiver() const override; 209 CRWJSInjectionReceiver* GetJSInjectionReceiver() const override;
209 void ExecuteJavaScript(const base::string16& javascript) override; 210 void ExecuteJavaScript(const base::string16& javascript) override;
210 void ExecuteJavaScript(const base::string16& javascript, 211 void ExecuteJavaScript(const base::string16& javascript,
211 const JavaScriptResultCallback& callback) override; 212 const JavaScriptResultCallback& callback) override;
212 const std::string& GetContentLanguageHeader() const override; 213 const std::string& GetContentLanguageHeader() const override;
213 const std::string& GetContentsMimeType() const override; 214 const std::string& GetContentsMimeType() const override;
214 bool ContentIsHTML() const override; 215 bool ContentIsHTML() const override;
215 const base::string16& GetTitle() const override; 216 const base::string16& GetTitle() const override;
216 bool IsLoading() const override; 217 bool IsLoading() const override;
217 double GetLoadingProgress() const override; 218 double GetLoadingProgress() const override;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 302
302 // Stores whether the web state is currently being destroyed. 303 // Stores whether the web state is currently being destroyed.
303 bool is_being_destroyed_; 304 bool is_being_destroyed_;
304 305
305 // The delegate used to pass state to the web contents facade. 306 // The delegate used to pass state to the web contents facade.
306 WebStateFacadeDelegate* facade_delegate_; 307 WebStateFacadeDelegate* facade_delegate_;
307 308
308 // The CRWWebController that backs this object. 309 // The CRWWebController that backs this object.
309 base::scoped_nsobject<CRWWebController> web_controller_; 310 base::scoped_nsobject<CRWWebController> web_controller_;
310 311
311 // The NavigationManagerImpl that stores session info for this WebStateImpl. 312 NavigationManagerImpl navigation_manager_;
312 std::unique_ptr<NavigationManagerImpl> navigation_manager_;
313 313
314 // |web::WebUIIOS| object for the current page if it is a WebUI page that 314 // |web::WebUIIOS| object for the current page if it is a WebUI page that
315 // uses the web-based WebUI framework, or nullptr otherwise. 315 // uses the web-based WebUI framework, or nullptr otherwise.
316 std::unique_ptr<web::WebUIIOS> web_ui_; 316 std::unique_ptr<web::WebUIIOS> web_ui_;
317 317
318 // A list of observers notified when page state changes. Weak references. 318 // A list of observers notified when page state changes. Weak references.
319 base::ObserverList<WebStateObserver, true> observers_; 319 base::ObserverList<WebStateObserver, true> observers_;
320 320
321 // All the WebStatePolicyDeciders asked for navigation decision. Weak 321 // All the WebStatePolicyDeciders asked for navigation decision. Weak
322 // references. 322 // references.
(...skipping 30 matching lines...) Expand all
353 353
354 // Image Fetcher used to images. 354 // Image Fetcher used to images.
355 std::unique_ptr<ImageDataFetcher> image_fetcher_; 355 std::unique_ptr<ImageDataFetcher> image_fetcher_;
356 356
357 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); 357 DISALLOW_COPY_AND_ASSIGN(WebStateImpl);
358 }; 358 };
359 359
360 } // namespace web 360 } // namespace web
361 361
362 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ 362 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
OLDNEW
« no previous file with comments | « ios/web/public/web_state/web_state.h ('k') | ios/web/web_state/web_state_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698