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 | |
Eugene But (OOO till 7-30)
2017/03/18 00:33:30
Could you please update the comment:
Whether this
kkhorimoto
2017/03/20 22:39:20
Done, although I left out the last sentence since
| |
64 bool created_with_opener; | |
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 // Removes the callback associated with |command_prefix|. | 228 // Removes the callback associated with |command_prefix|. |
225 virtual void RemoveScriptCommandCallback( | 229 virtual void RemoveScriptCommandCallback( |
226 const std::string& command_prefix) = 0; | 230 const std::string& command_prefix) = 0; |
227 | 231 |
228 // Returns the current CRWWebViewProxy object. | 232 // Returns the current CRWWebViewProxy object. |
229 virtual CRWWebViewProxyType GetWebViewProxy() const = 0; | 233 virtual CRWWebViewProxyType GetWebViewProxy() const = 0; |
230 | 234 |
231 // Returns Mojo interface registry for this WebState. | 235 // Returns Mojo interface registry for this WebState. |
232 virtual service_manager::InterfaceRegistry* GetMojoInterfaceRegistry() = 0; | 236 virtual service_manager::InterfaceRegistry* GetMojoInterfaceRegistry() = 0; |
233 | 237 |
238 // Returns whether this WebState was created via a call to window.open or by | |
239 // clicking a link with a blank targer. | |
Eugene But (OOO till 7-30)
2017/03/18 00:33:30
How about this comment?:
Whether this WebState was
kkhorimoto
2017/03/20 22:39:20
Done.
| |
240 virtual bool HasOpener() const = 0; | |
241 | |
234 protected: | 242 protected: |
235 friend class WebStateObserver; | 243 friend class WebStateObserver; |
236 friend class WebStatePolicyDecider; | 244 friend class WebStatePolicyDecider; |
237 | 245 |
238 // Adds and removes observers for page navigation notifications. The order in | 246 // Adds and removes observers for page navigation notifications. The order in |
239 // which notifications are sent to observers is undefined. Clients must be | 247 // which notifications are sent to observers is undefined. Clients must be |
240 // sure to remove the observer before they go away. | 248 // sure to remove the observer before they go away. |
241 // TODO(droger): Move these methods to WebStateImpl once it is in ios/. | 249 // TODO(droger): Move these methods to WebStateImpl once it is in ios/. |
242 virtual void AddObserver(WebStateObserver* observer) = 0; | 250 virtual void AddObserver(WebStateObserver* observer) = 0; |
243 virtual void RemoveObserver(WebStateObserver* observer) = 0; | 251 virtual void RemoveObserver(WebStateObserver* observer) = 0; |
(...skipping 12 matching lines...) Expand all Loading... | |
256 | 264 |
257 // Returns a WeakPtr<WebState> to the current WebState. Must remain private | 265 // Returns a WeakPtr<WebState> to the current WebState. Must remain private |
258 // and only call must be in WebStateWeakPtrFactory. Please consult that class | 266 // and only call must be in WebStateWeakPtrFactory. Please consult that class |
259 // for more details. Remove as part of http://crbug.com/556736. | 267 // for more details. Remove as part of http://crbug.com/556736. |
260 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; | 268 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; |
261 }; | 269 }; |
262 | 270 |
263 } // namespace web | 271 } // namespace web |
264 | 272 |
265 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 273 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
OLD | NEW |