crw_web_view_content_view.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef IOS_WEB_COMMON_CRW_WEB_VIEW_CONTENT_VIEW_H_
  5. #define IOS_WEB_COMMON_CRW_WEB_VIEW_CONTENT_VIEW_H_
  6. #import <WebKit/WebKit.h>
  7. #import "ios/web/common/crw_content_view.h"
  8. #import "ios/web/common/crw_viewport_adjustment.h"
  9. // Wraps a web vew in a CRWContentView.
  10. @interface CRWWebViewContentView : CRWContentView <CRWViewportAdjustment>
  11. // The webView passed to |-initWithWebView|.
  12. @property(nonatomic, strong, readonly) UIView* webView;
  13. // The fullscreen state of this view
  14. @property(nonatomic, readonly) CrFullscreenState fullscreenState;
  15. // Initializes the CRWWebViewContentView to display |webView| and passes state
  16. // of fullscreen mode. This should pass in a default value of
  17. // CrFullscreenState (e.g., kNotInFullScreen).
  18. - (instancetype)initWithWebView:(UIView*)webView
  19. scrollView:(UIScrollView*)scrollView
  20. fullscreenState:(CrFullscreenState)fullscreenState
  21. NS_DESIGNATED_INITIALIZER;
  22. // Available only for testing.
  23. - (instancetype)initForTesting NS_DESIGNATED_INITIALIZER;
  24. // CRWWebViewContentViews should be initialized via |-initWithWebView:
  25. // scrollView:|.
  26. - (instancetype)initWithCoder:(NSCoder*)decoder NS_UNAVAILABLE;
  27. - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
  28. - (void)updateFullscreenState:(CrFullscreenState)fullscreenState;
  29. @end
  30. #endif // IOS_WEB_COMMON_CRW_WEB_VIEW_CONTENT_VIEW_H_