Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: ios/web/public/web_state/web_state.h

Issue 2945213002: [ios] Snapshot for WebState (Closed)
Patch Set: Address comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/web/public/test/fakes/test_web_state.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « ios/web/public/test/fakes/test_web_state.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698