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 17 matching lines...) Expand all Loading... |
28 @protocol CRWWebViewProxy; | 28 @protocol CRWWebViewProxy; |
29 typedef id<CRWWebViewProxy> CRWWebViewProxyType; | 29 typedef id<CRWWebViewProxy> CRWWebViewProxyType; |
30 @class UIView; | 30 @class UIView; |
31 typedef UIView<CRWScrollableContent> CRWContentView; | 31 typedef UIView<CRWScrollableContent> CRWContentView; |
32 | 32 |
33 namespace base { | 33 namespace base { |
34 class DictionaryValue; | 34 class DictionaryValue; |
35 class Value; | 35 class Value; |
36 } | 36 } |
37 | 37 |
| 38 namespace gfx { |
| 39 class Image; |
| 40 } |
| 41 |
38 namespace web { | 42 namespace web { |
39 | 43 |
40 class BrowserState; | 44 class BrowserState; |
41 class NavigationManager; | 45 class NavigationManager; |
42 class SessionCertificatePolicyCache; | 46 class SessionCertificatePolicyCache; |
43 class WebInterstitial; | 47 class WebInterstitial; |
44 class WebStateDelegate; | 48 class WebStateDelegate; |
45 class WebStateInterfaceProvider; | 49 class WebStateInterfaceProvider; |
46 class WebStateObserver; | 50 class WebStateObserver; |
47 class WebStatePolicyDecider; | 51 class WebStatePolicyDecider; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // Returns the current CRWWebViewProxy object. | 245 // Returns the current CRWWebViewProxy object. |
242 virtual CRWWebViewProxyType GetWebViewProxy() const = 0; | 246 virtual CRWWebViewProxyType GetWebViewProxy() const = 0; |
243 | 247 |
244 // Returns Mojo interface registry for this WebState. | 248 // Returns Mojo interface registry for this WebState. |
245 virtual WebStateInterfaceProvider* GetWebStateInterfaceProvider() = 0; | 249 virtual WebStateInterfaceProvider* GetWebStateInterfaceProvider() = 0; |
246 | 250 |
247 // Returns whether this WebState was created with an opener. See | 251 // Returns whether this WebState was created with an opener. See |
248 // CreateParams::created_with_opener for more details. | 252 // CreateParams::created_with_opener for more details. |
249 virtual bool HasOpener() const = 0; | 253 virtual bool HasOpener() const = 0; |
250 | 254 |
| 255 // Callback used to handle snapshots. The parameter is the snapshot image. |
| 256 typedef base::Callback<void(const gfx::Image&)> SnapshotCallback; |
| 257 |
| 258 // Takes a snapshot of this WebState with |target_size|. |callback| is |
| 259 // asynchronously invoked after performing the snapshot. |
| 260 virtual void TakeSnapshot(const SnapshotCallback& callback, |
| 261 CGSize target_size) const = 0; |
| 262 |
251 protected: | 263 protected: |
252 friend class WebStateObserver; | 264 friend class WebStateObserver; |
253 friend class WebStatePolicyDecider; | 265 friend class WebStatePolicyDecider; |
254 | 266 |
255 // Adds and removes observers for page navigation notifications. The order in | 267 // Adds and removes observers for page navigation notifications. The order in |
256 // which notifications are sent to observers is undefined. Clients must be | 268 // which notifications are sent to observers is undefined. Clients must be |
257 // sure to remove the observer before they go away. | 269 // sure to remove the observer before they go away. |
258 // TODO(droger): Move these methods to WebStateImpl once it is in ios/. | 270 // TODO(droger): Move these methods to WebStateImpl once it is in ios/. |
259 virtual void AddObserver(WebStateObserver* observer) = 0; | 271 virtual void AddObserver(WebStateObserver* observer) = 0; |
260 virtual void RemoveObserver(WebStateObserver* observer) = 0; | 272 virtual void RemoveObserver(WebStateObserver* observer) = 0; |
(...skipping 12 matching lines...) Expand all Loading... |
273 | 285 |
274 // Returns a WeakPtr<WebState> to the current WebState. Must remain private | 286 // Returns a WeakPtr<WebState> to the current WebState. Must remain private |
275 // and only call must be in WebStateWeakPtrFactory. Please consult that class | 287 // and only call must be in WebStateWeakPtrFactory. Please consult that class |
276 // for more details. Remove as part of http://crbug.com/556736. | 288 // for more details. Remove as part of http://crbug.com/556736. |
277 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; | 289 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; |
278 }; | 290 }; |
279 | 291 |
280 } // namespace web | 292 } // namespace web |
281 | 293 |
282 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 294 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
OLD | NEW |