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

Side by Side Diff: ios/web/public/web_state/web_state.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
« no previous file with comments | « ios/web/public/test/fakes/test_web_state.mm ('k') | ios/web/web_state/web_state_impl.h » ('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_PUBLIC_WEB_STATE_WEB_STATE_H_ 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_
6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ 6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/supports_user_data.h" 15 #include "base/supports_user_data.h"
16 #include "ios/web/public/referrer.h" 16 #include "ios/web/public/referrer.h"
17 #include "ios/web/public/web_state/url_verification_constants.h" 17 #include "ios/web/public/web_state/url_verification_constants.h"
18 #include "ui/base/page_transition_types.h" 18 #include "ui/base/page_transition_types.h"
19 #include "ui/base/window_open_disposition.h" 19 #include "ui/base/window_open_disposition.h"
20 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
21 #include "url/gurl.h" 21 #include "url/gurl.h"
22 22
23 class GURL; 23 class GURL;
24 class SkBitmap; 24 class SkBitmap;
25 25
26 @class CRWJSInjectionReceiver; 26 @class CRWJSInjectionReceiver;
27 @class CRWNavigationManagerStorage;
28 @protocol CRWScrollableContent; 27 @protocol CRWScrollableContent;
29 @protocol CRWWebViewProxy; 28 @protocol CRWWebViewProxy;
30 typedef id<CRWWebViewProxy> CRWWebViewProxyType; 29 typedef id<CRWWebViewProxy> CRWWebViewProxyType;
31 @class UIView; 30 @class UIView;
32 typedef UIView<CRWScrollableContent> CRWContentView; 31 typedef UIView<CRWScrollableContent> CRWContentView;
33 32
34 namespace base { 33 namespace base {
35 class DictionaryValue; 34 class DictionaryValue;
36 class Value; 35 class Value;
37 } 36 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 const std::vector<SkBitmap>&, /* bitmaps */ 91 const std::vector<SkBitmap>&, /* bitmaps */
93 /* The sizes in pixel of the bitmaps before they were resized due to the 92 /* The sizes in pixel of the bitmaps before they were resized due to the
94 max bitmap size passed to DownloadImage(). Each entry in the bitmaps 93 max bitmap size passed to DownloadImage(). Each entry in the bitmaps
95 vector corresponds to an entry in the sizes vector. If a bitmap was 94 vector corresponds to an entry in the sizes vector. If a bitmap was
96 resized, there should be a single returned bitmap. */ 95 resized, there should be a single returned bitmap. */
97 const std::vector<gfx::Size>&)> 96 const std::vector<gfx::Size>&)>
98 ImageDownloadCallback; 97 ImageDownloadCallback;
99 98
100 // Creates a new WebState. 99 // Creates a new WebState.
101 static std::unique_ptr<WebState> Create(const CreateParams& params); 100 static std::unique_ptr<WebState> Create(const CreateParams& params);
102 // Creates a new WebState from a serialized NavigationManager.
103 static std::unique_ptr<WebState> Create(
104 const CreateParams& params,
105 CRWNavigationManagerStorage* session_storage);
106 101
107 ~WebState() override {} 102 ~WebState() override {}
108 103
109 // Gets/Sets the delegate. 104 // Gets/Sets the delegate.
110 virtual WebStateDelegate* GetDelegate() = 0; 105 virtual WebStateDelegate* GetDelegate() = 0;
111 virtual void SetDelegate(WebStateDelegate* delegate) = 0; 106 virtual void SetDelegate(WebStateDelegate* delegate) = 0;
112 107
113 // Whether or not a web view is allowed to exist in this WebState. Defaults 108 // Whether or not a web view is allowed to exist in this WebState. Defaults
114 // to false; this should be enabled before attempting to access the view. 109 // to false; this should be enabled before attempting to access the view.
115 virtual bool IsWebUsageEnabled() const = 0; 110 virtual bool IsWebUsageEnabled() const = 0;
(...skipping 17 matching lines...) Expand all
133 virtual void OpenURL(const OpenURLParams& params) = 0; 128 virtual void OpenURL(const OpenURLParams& params) = 0;
134 129
135 // Stops any pending navigation. 130 // Stops any pending navigation.
136 virtual void Stop() = 0; 131 virtual void Stop() = 0;
137 132
138 // Gets the NavigationManager associated with this WebState. Can never return 133 // Gets the NavigationManager associated with this WebState. Can never return
139 // null. 134 // null.
140 virtual const NavigationManager* GetNavigationManager() const = 0; 135 virtual const NavigationManager* GetNavigationManager() const = 0;
141 virtual NavigationManager* GetNavigationManager() = 0; 136 virtual NavigationManager* GetNavigationManager() = 0;
142 137
143 // Creates a serialized version of the NavigationManager. The returned value
144 // is autoreleased.
145 virtual CRWNavigationManagerStorage* BuildSerializedNavigationManager() = 0;
146
147 // Gets the CRWJSInjectionReceiver associated with this WebState. 138 // Gets the CRWJSInjectionReceiver associated with this WebState.
148 virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0; 139 virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0;
149 140
150 // Runs JavaScript in the main frame's context. If a callback is provided, it 141 // Runs JavaScript in the main frame's context. If a callback is provided, it
151 // will be used to return the result, when the result is available or script 142 // will be used to return the result, when the result is available or script
152 // execution has failed due to an error. 143 // execution has failed due to an error.
153 // NOTE: Integer values will be returned as Type::DOUBLE because of underlying 144 // NOTE: Integer values will be returned as Type::DOUBLE because of underlying
154 // library limitation. 145 // library limitation.
155 typedef base::Callback<void(const base::Value*)> JavaScriptResultCallback; 146 typedef base::Callback<void(const base::Value*)> JavaScriptResultCallback;
156 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; 147 virtual void ExecuteJavaScript(const base::string16& javascript) = 0;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 272
282 // Returns a WeakPtr<WebState> to the current WebState. Must remain private 273 // Returns a WeakPtr<WebState> to the current WebState. Must remain private
283 // and only call must be in WebStateWeakPtrFactory. Please consult that class 274 // and only call must be in WebStateWeakPtrFactory. Please consult that class
284 // for more details. Remove as part of http://crbug.com/556736. 275 // for more details. Remove as part of http://crbug.com/556736.
285 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; 276 virtual base::WeakPtr<WebState> AsWeakPtr() = 0;
286 }; 277 };
287 278
288 } // namespace web 279 } // namespace web
289 280
290 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ 281 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_
OLDNEW
« no previous file with comments | « ios/web/public/test/fakes/test_web_state.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698