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> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 class WebStateWeakPtrFactory; | 50 class WebStateWeakPtrFactory; |
51 | 51 |
52 // Core interface for interaction with the web. | 52 // Core interface for interaction with the web. |
53 class WebState : public base::SupportsUserData { | 53 class WebState : public base::SupportsUserData { |
54 public: | 54 public: |
55 // Parameters for the Create() method. | 55 // Parameters for the Create() method. |
56 struct CreateParams { | 56 struct CreateParams { |
57 explicit CreateParams(web::BrowserState* browser_state); | 57 explicit CreateParams(web::BrowserState* browser_state); |
58 ~CreateParams(); | 58 ~CreateParams(); |
59 | 59 |
60 // The corresponding BrowserState for the new WebState. | |
60 web::BrowserState* browser_state; | 61 web::BrowserState* browser_state; |
62 | |
63 // Whether the WebState is created as the result of a window.open | |
64 bool opened_by_dom; | |
Eugene But (OOO till 7-30)
2017/03/16 15:31:19
Content has this boolean, which actually better re
kkhorimoto
2017/03/17 23:04:49
Done.
| |
61 }; | 65 }; |
62 | 66 |
63 // Parameters for the OpenURL() method. | 67 // Parameters for the OpenURL() method. |
64 struct OpenURLParams { | 68 struct OpenURLParams { |
65 OpenURLParams(const GURL& url, | 69 OpenURLParams(const GURL& url, |
66 const Referrer& referrer, | 70 const Referrer& referrer, |
67 WindowOpenDisposition disposition, | 71 WindowOpenDisposition disposition, |
68 ui::PageTransition transition, | 72 ui::PageTransition transition, |
69 bool is_renderer_initiated); | 73 bool is_renderer_initiated); |
70 ~OpenURLParams(); | 74 ~OpenURLParams(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 // Removes the callback associated with |command_prefix|. | 227 // Removes the callback associated with |command_prefix|. |
224 virtual void RemoveScriptCommandCallback( | 228 virtual void RemoveScriptCommandCallback( |
225 const std::string& command_prefix) = 0; | 229 const std::string& command_prefix) = 0; |
226 | 230 |
227 // Returns the current CRWWebViewProxy object. | 231 // Returns the current CRWWebViewProxy object. |
228 virtual CRWWebViewProxyType GetWebViewProxy() const = 0; | 232 virtual CRWWebViewProxyType GetWebViewProxy() const = 0; |
229 | 233 |
230 // Returns Mojo interface registry for this WebState. | 234 // Returns Mojo interface registry for this WebState. |
231 virtual service_manager::InterfaceRegistry* GetMojoInterfaceRegistry() = 0; | 235 virtual service_manager::InterfaceRegistry* GetMojoInterfaceRegistry() = 0; |
232 | 236 |
237 // Returns whether this WebState was created via a call to window.open or by | |
238 // clicking a link with a blank targer. | |
239 virtual bool IsOpenedByDOM() const = 0; | |
Eugene But (OOO till 7-30)
2017/03/16 15:31:19
Is this the same as content's HasOpener() ?
kkhorimoto
2017/03/17 23:04:49
Yes, it looks like it. I've updated the naming.
| |
240 | |
233 protected: | 241 protected: |
234 friend class WebStateObserver; | 242 friend class WebStateObserver; |
235 friend class WebStatePolicyDecider; | 243 friend class WebStatePolicyDecider; |
236 | 244 |
237 // Adds and removes observers for page navigation notifications. The order in | 245 // Adds and removes observers for page navigation notifications. The order in |
238 // which notifications are sent to observers is undefined. Clients must be | 246 // which notifications are sent to observers is undefined. Clients must be |
239 // sure to remove the observer before they go away. | 247 // sure to remove the observer before they go away. |
240 // TODO(droger): Move these methods to WebStateImpl once it is in ios/. | 248 // TODO(droger): Move these methods to WebStateImpl once it is in ios/. |
241 virtual void AddObserver(WebStateObserver* observer) = 0; | 249 virtual void AddObserver(WebStateObserver* observer) = 0; |
242 virtual void RemoveObserver(WebStateObserver* observer) = 0; | 250 virtual void RemoveObserver(WebStateObserver* observer) = 0; |
(...skipping 12 matching lines...) Expand all Loading... | |
255 | 263 |
256 // Returns a WeakPtr<WebState> to the current WebState. Must remain private | 264 // Returns a WeakPtr<WebState> to the current WebState. Must remain private |
257 // and only call must be in WebStateWeakPtrFactory. Please consult that class | 265 // and only call must be in WebStateWeakPtrFactory. Please consult that class |
258 // for more details. Remove as part of http://crbug.com/556736. | 266 // for more details. Remove as part of http://crbug.com/556736. |
259 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; | 267 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; |
260 }; | 268 }; |
261 | 269 |
262 } // namespace web | 270 } // namespace web |
263 | 271 |
264 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 272 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
OLD | NEW |