crw_viewport_adjustment.h 998 B

12345678910111213141516171819202122232425
  1. // Copyright 2020 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_VIEWPORT_ADJUSTMENT_H_
  5. #define IOS_WEB_COMMON_CRW_VIEWPORT_ADJUSTMENT_H_
  6. #import <UIKit/UIKit.h>
  7. // Protocol used to update a page's viewport when part of the web view is
  8. // covered by browser UI (e.g. toolbars).
  9. @protocol CRWViewportAdjustment <NSObject>
  10. // The viewport insets into the web view that are covered by the Browser UI.
  11. @property(nonatomic, assign) UIEdgeInsets viewportInsets;
  12. // The viewport's affected viewport edges that are affected by the web view's
  13. // safe area insets.
  14. @property(nonatomic, readonly) UIRectEdge viewportEdgesAffectedBySafeArea;
  15. // Updates maximum and minimum viewport insets for the wrapper.
  16. - (void)updateMinViewportInsets:(UIEdgeInsets)minInsets
  17. maxViewportInsets:(UIEdgeInsets)maxInsets;
  18. @end
  19. #endif // IOS_WEB_COMMON_CRW_VIEWPORT_ADJUSTMENT_H_