crw_pending_navigation_info.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2019 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_NAVIGATION_CRW_PENDING_NAVIGATION_INFO_H_
  5. #define IOS_WEB_NAVIGATION_CRW_PENDING_NAVIGATION_INFO_H_
  6. #import <UIKit/UIKit.h>
  7. #import <WebKit/WebKit.h>
  8. #include "net/http/http_response_headers.h"
  9. // A container object for any navigation information that is only available
  10. // during pre-commit delegate callbacks, and thus must be held until the
  11. // navigation commits and the information can be used.
  12. @interface CRWPendingNavigationInfo : NSObject
  13. // The referrer for the page.
  14. @property(nonatomic, copy) NSString* referrer;
  15. // The MIME type for the page.
  16. @property(nonatomic, copy) NSString* MIMEType;
  17. // The navigation type for the load.
  18. @property(nonatomic, assign) WKNavigationType navigationType;
  19. // HTTP request method for the load.
  20. @property(nonatomic, copy) NSString* HTTPMethod;
  21. // HTTP headers.
  22. @property(nonatomic, assign) scoped_refptr<net::HttpResponseHeaders>
  23. HTTPHeaders;
  24. // Whether the pending navigation has been cancelled by an embedder before the
  25. // navigation is committed. Cancelled navigations without a cancellation error
  26. // should simply be discarded.
  27. @property(nonatomic, assign) BOOL cancelled;
  28. // The error to display if the pending navigation was cancelled by an embedder
  29. // using PolicyDecision::CancelAndDisplayError().
  30. @property(nonatomic, copy) NSError* cancellationError;
  31. // Whether the navigation was initiated by a user gesture.
  32. @property(nonatomic, assign) BOOL hasUserGesture;
  33. // Whether the navigation had a server redirect.
  34. @property(nonatomic, assign) BOOL unsafeRedirect;
  35. @end
  36. #endif // IOS_WEB_NAVIGATION_CRW_PENDING_NAVIGATION_INFO_H_