Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #import "base/mac/scoped_nsobject.h" | |
| 14 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 15 #include "base/supports_user_data.h" | 16 #include "base/supports_user_data.h" |
| 16 #include "ios/web/public/referrer.h" | 17 #include "ios/web/public/referrer.h" |
| 17 #include "ios/web/public/web_state/url_verification_constants.h" | 18 #include "ios/web/public/web_state/url_verification_constants.h" |
| 18 #include "ui/base/page_transition_types.h" | 19 #include "ui/base/page_transition_types.h" |
| 19 #include "ui/base/window_open_disposition.h" | 20 #include "ui/base/window_open_disposition.h" |
| 20 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
| 21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 22 | 23 |
| 23 class GURL; | 24 class GURL; |
| 24 class SkBitmap; | 25 class SkBitmap; |
| 25 | 26 |
| 26 @class CRWJSInjectionReceiver; | 27 @class CRWJSInjectionReceiver; |
| 28 @class CRWNavigationManagerSerialization; | |
| 27 @protocol CRWScrollableContent; | 29 @protocol CRWScrollableContent; |
| 28 @protocol CRWWebViewProxy; | 30 @protocol CRWWebViewProxy; |
| 29 typedef id<CRWWebViewProxy> CRWWebViewProxyType; | 31 typedef id<CRWWebViewProxy> CRWWebViewProxyType; |
| 30 @class UIView; | 32 @class UIView; |
| 31 typedef UIView<CRWScrollableContent> CRWContentView; | 33 typedef UIView<CRWScrollableContent> CRWContentView; |
| 32 | 34 |
| 33 namespace base { | 35 namespace base { |
| 34 class DictionaryValue; | 36 class DictionaryValue; |
| 35 class Value; | 37 class Value; |
| 36 } | 38 } |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 47 class WebStateDelegate; | 49 class WebStateDelegate; |
| 48 class WebStateObserver; | 50 class WebStateObserver; |
| 49 class WebStatePolicyDecider; | 51 class WebStatePolicyDecider; |
| 50 class WebStateWeakPtrFactory; | 52 class WebStateWeakPtrFactory; |
| 51 | 53 |
| 52 // Core interface for interaction with the web. | 54 // Core interface for interaction with the web. |
| 53 class WebState : public base::SupportsUserData { | 55 class WebState : public base::SupportsUserData { |
| 54 public: | 56 public: |
| 55 // Parameters for the Create() method. | 57 // Parameters for the Create() method. |
| 56 struct CreateParams { | 58 struct CreateParams { |
| 59 // Constructor used to create new WebStates. | |
| 57 explicit CreateParams(web::BrowserState* browser_state); | 60 explicit CreateParams(web::BrowserState* browser_state); |
| 61 // Constructor used to create a WebState with restores session history. | |
| 62 explicit CreateParams(web::BrowserState* browser_state, | |
| 63 CRWNavigationManagerSerialization* serialization); | |
|
Eugene But (OOO till 7-30)
2017/01/25 16:03:38
Content does not have serialized state in CreatePa
kkhorimoto
2017/01/26 07:19:10
Done.
| |
| 58 ~CreateParams(); | 64 ~CreateParams(); |
| 59 | 65 |
| 60 web::BrowserState* browser_state; | 66 web::BrowserState* browser_state; |
| 67 base::scoped_nsobject<CRWNavigationManagerSerialization> serialization; | |
| 61 }; | 68 }; |
| 62 | 69 |
| 63 // Parameters for the OpenURL() method. | 70 // Parameters for the OpenURL() method. |
| 64 struct OpenURLParams { | 71 struct OpenURLParams { |
| 65 OpenURLParams(const GURL& url, | 72 OpenURLParams(const GURL& url, |
| 66 const Referrer& referrer, | 73 const Referrer& referrer, |
| 67 WindowOpenDisposition disposition, | 74 WindowOpenDisposition disposition, |
| 68 ui::PageTransition transition, | 75 ui::PageTransition transition, |
| 69 bool is_renderer_initiated); | 76 bool is_renderer_initiated); |
| 70 ~OpenURLParams(); | 77 ~OpenURLParams(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 virtual void OpenURL(const OpenURLParams& params) = 0; | 135 virtual void OpenURL(const OpenURLParams& params) = 0; |
| 129 | 136 |
| 130 // Stops any pending navigation. | 137 // Stops any pending navigation. |
| 131 virtual void Stop() = 0; | 138 virtual void Stop() = 0; |
| 132 | 139 |
| 133 // Gets the NavigationManager associated with this WebState. Can never return | 140 // Gets the NavigationManager associated with this WebState. Can never return |
| 134 // null. | 141 // null. |
| 135 virtual const NavigationManager* GetNavigationManager() const = 0; | 142 virtual const NavigationManager* GetNavigationManager() const = 0; |
| 136 virtual NavigationManager* GetNavigationManager() = 0; | 143 virtual NavigationManager* GetNavigationManager() = 0; |
| 137 | 144 |
| 145 // Creates a serialized version of the NavigationManager. The returned value | |
| 146 // is autoreleased. | |
| 147 virtual CRWNavigationManagerSerialization* | |
| 148 BuildSerializedNavigationManager() = 0; | |
| 149 | |
| 138 // Gets the CRWJSInjectionReceiver associated with this WebState. | 150 // Gets the CRWJSInjectionReceiver associated with this WebState. |
| 139 virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0; | 151 virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0; |
| 140 | 152 |
| 141 // Runs JavaScript in the main frame's context. If a callback is provided, it | 153 // Runs JavaScript in the main frame's context. If a callback is provided, it |
| 142 // will be used to return the result, when the result is available or script | 154 // will be used to return the result, when the result is available or script |
| 143 // execution has failed due to an error. | 155 // execution has failed due to an error. |
| 144 // NOTE: Integer values will be returned as Type::DOUBLE because of underlying | 156 // NOTE: Integer values will be returned as Type::DOUBLE because of underlying |
| 145 // library limitation. | 157 // library limitation. |
| 146 typedef base::Callback<void(const base::Value*)> JavaScriptResultCallback; | 158 typedef base::Callback<void(const base::Value*)> JavaScriptResultCallback; |
| 147 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; | 159 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 | 284 |
| 273 // Returns a WeakPtr<WebState> to the current WebState. Must remain private | 285 // Returns a WeakPtr<WebState> to the current WebState. Must remain private |
| 274 // and only call must be in WebStateWeakPtrFactory. Please consult that class | 286 // and only call must be in WebStateWeakPtrFactory. Please consult that class |
| 275 // for more details. Remove as part of http://crbug.com/556736. | 287 // for more details. Remove as part of http://crbug.com/556736. |
| 276 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; | 288 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; |
| 277 }; | 289 }; |
| 278 | 290 |
| 279 } // namespace web | 291 } // namespace web |
| 280 | 292 |
| 281 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 293 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
| OLD | NEW |