| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_NAVIGATION_CRW_SESSION_ENTRY_H_ | 5 #ifndef IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ |
| 6 #define IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ | 6 #define IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "ui/base/page_transition_types.h" | 15 #include "ui/base/page_transition_types.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 namespace web { | 18 namespace web { |
| 19 class NavigationItem; | 19 class NavigationItem; |
| 20 class NavigationItemImpl; | 20 class NavigationItemImpl; |
| 21 | |
| 22 // Keys used to serialize web::PageScrollState properties. | |
| 23 extern NSString* const kSessionEntryPageScrollStateKey; | |
| 24 extern NSString* const kSessionEntryScrollOffsetXKey; | |
| 25 extern NSString* const kSessionEntryScrollOffsetYKey; | |
| 26 extern NSString* const kSessionEntryMinimumZoomScaleKey; | |
| 27 extern NSString* const kSessionEntryMaximumZoomScaleKey; | |
| 28 extern NSString* const kSessionEntryZoomScaleKey; | |
| 29 | |
| 30 // Keys used to serialize navigation properties. | |
| 31 | |
| 32 // Current URL (std::string). | |
| 33 extern NSString* const kSessionEntryURLKey; | |
| 34 // Current URL. Deprecated, used for backward compatibility (NSURL). | |
| 35 extern NSString* const kSessionEntryURLDeperecatedKey; | |
| 36 // Page referrer URL (std::string). | |
| 37 extern NSString* const kSessionEntryReferrerURLKey; | |
| 38 // Page referrer URL (NSURL). Deprecated, used for backward compatibility. | |
| 39 extern NSString* const kSessionEntryReferrerURLDeprecatedKey; | |
| 40 // Page referrer policy (int). | |
| 41 extern NSString* const kSessionEntryReferrerPolicyKey; | |
| 42 // The time at which the last known local navigation has completed (int64_t). | |
| 43 extern NSString* const kSessionEntryTimestampKey; | |
| 44 // Page title (NSString). | |
| 45 extern NSString* const kSessionEntryTitleKey; | |
| 46 // POST request data (NSData). | |
| 47 extern NSString* const kSessionEntryPOSTDataKey; | |
| 48 // HTTP request headers (NSDictionary). | |
| 49 extern NSString* const kSessionEntryHTTPRequestHeadersKey; | |
| 50 // Whether or not to bypass showing the resubmit data confirmation when loading | |
| 51 // a POST request (BOOL). | |
| 52 extern NSString* const kSessionEntrySkipRepostFormConfirmationKey; | |
| 53 // Should desktop user agent be used (BOOL)? | |
| 54 extern NSString* const kSessionEntryUseDesktopUserAgentKey; | |
| 55 } | 21 } |
| 56 | 22 |
| 57 // A CRWSessionEntry is similar to a NavigationEntry object in desktop Chrome. | 23 // A CRWSessionEntry is similar to a NavigationEntry object in desktop Chrome. |
| 58 // It maintains the information needed to save/restore a single entry in session | 24 // It maintains the information needed to save/restore a single entry in session |
| 59 // history (i.e., one site) for a tab. A tab may have multiple of these objects | 25 // history (i.e., one site) for a tab. A tab may have multiple of these objects |
| 60 // comprising its entire session history. | 26 // comprising its entire session history. |
| 61 // DEPRECATED, do not use this class and do not add any methods to it. | 27 // DEPRECATED, do not use this class and do not add any methods to it. |
| 62 // Use web::NavigationItem instead. | 28 // Use web::NavigationItem instead. |
| 63 // TODO(crbug.com/454984): Remove this class. | 29 // TODO(crbug.com/454984): Remove this class. |
| 64 @interface CRWSessionEntry : NSObject<NSCoding, NSCopying> | 30 @interface CRWSessionEntry : NSObject<NSCopying> |
| 65 | 31 |
| 66 // Pointer to the NavigationItem associated with this CRWSessionEntry. | 32 // Pointer to the NavigationItem associated with this CRWSessionEntry. |
| 67 // Eventually, this will replace CRWSessionEntry entirely. | 33 // Eventually, this will replace CRWSessionEntry entirely. |
| 68 @property(nonatomic, readonly) web::NavigationItem* navigationItem; | 34 @property(nonatomic, readonly) web::NavigationItem* navigationItem; |
| 69 | 35 |
| 70 // Pointer to the NavigationItemImpl associated with this CRWSessionEntry. | 36 // Pointer to the NavigationItemImpl associated with this CRWSessionEntry. |
| 71 @property(nonatomic, readonly) web::NavigationItemImpl* navigationItemImpl; | 37 @property(nonatomic, readonly) web::NavigationItemImpl* navigationItemImpl; |
| 72 | 38 |
| 73 // Initialize the session entry with the given NavigationItem. | 39 // Initialize the session entry with the given NavigationItem. |
| 74 - (instancetype)initWithNavigationItem: | 40 - (instancetype)initWithNavigationItem: |
| 75 (std::unique_ptr<web::NavigationItem>)item; | 41 (std::unique_ptr<web::NavigationItem>)item; |
| 76 | 42 |
| 77 @end | 43 @end |
| 78 | 44 |
| 79 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ | 45 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ |
| OLD | NEW |