| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Gets/Sets the delegate. | 94 // Gets/Sets the delegate. |
| 95 virtual WebStateDelegate* GetDelegate() = 0; | 95 virtual WebStateDelegate* GetDelegate() = 0; |
| 96 virtual void SetDelegate(WebStateDelegate* delegate) = 0; | 96 virtual void SetDelegate(WebStateDelegate* delegate) = 0; |
| 97 | 97 |
| 98 // Whether or not a web view is allowed to exist in this WebState. Defaults | 98 // Whether or not a web view is allowed to exist in this WebState. Defaults |
| 99 // to false; this should be enabled before attempting to access the view. | 99 // to false; this should be enabled before attempting to access the view. |
| 100 virtual bool IsWebUsageEnabled() const = 0; | 100 virtual bool IsWebUsageEnabled() const = 0; |
| 101 virtual void SetWebUsageEnabled(bool enabled) = 0; | 101 virtual void SetWebUsageEnabled(bool enabled) = 0; |
| 102 | 102 |
| 103 // Whether or not dialogs (JavaScript dialogs, HTTP auths and window.open) | 103 // Whether or not dialogs (JavaScript, geolocation) and window open requests |
| 104 // calls should be suppressed. Default is false. | 104 // should be suppressed. Default is false. When dialog is suppressed |
| 105 // |WebStateObserver::DidSuppressDialog| will be called. |
| 105 virtual bool ShouldSuppressDialogs() const = 0; | 106 virtual bool ShouldSuppressDialogs() const = 0; |
| 106 virtual void SetShouldSuppressDialogs(bool should_suppress) = 0; | 107 virtual void SetShouldSuppressDialogs(bool should_suppress) = 0; |
| 107 | 108 |
| 108 // The view containing the contents of the current web page. If the view has | 109 // The view containing the contents of the current web page. If the view has |
| 109 // been purged due to low memory, this will recreate it. It is up to the | 110 // been purged due to low memory, this will recreate it. It is up to the |
| 110 // caller to size the view. | 111 // caller to size the view. |
| 111 virtual UIView* GetView() = 0; | 112 virtual UIView* GetView() = 0; |
| 112 | 113 |
| 113 // Gets the BrowserState associated with this WebState. Can never return null. | 114 // Gets the BrowserState associated with this WebState. Can never return null. |
| 114 virtual BrowserState* GetBrowserState() const = 0; | 115 virtual BrowserState* GetBrowserState() const = 0; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 256 |
| 256 // Returns a WeakPtr<WebState> to the current WebState. Must remain private | 257 // Returns a WeakPtr<WebState> to the current WebState. Must remain private |
| 257 // and only call must be in WebStateWeakPtrFactory. Please consult that class | 258 // and only call must be in WebStateWeakPtrFactory. Please consult that class |
| 258 // for more details. Remove as part of http://crbug.com/556736. | 259 // for more details. Remove as part of http://crbug.com/556736. |
| 259 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; | 260 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; |
| 260 }; | 261 }; |
| 261 | 262 |
| 262 } // namespace web | 263 } // namespace web |
| 263 | 264 |
| 264 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 265 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
| OLD | NEW |