Chromium Code Reviews| 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 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "ui/base/page_transition_types.h" | 13 #include "ui/base/page_transition_types.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace web { | 16 namespace web { |
| 17 class NavigationItem; | 17 class NavigationItem; |
| 18 class NavigationItemImpl; | 18 class NavigationItemImpl; |
| 19 struct Referrer; | 19 struct Referrer; |
| 20 | |
| 21 // Keys used to serialize web::PageScrollState properties. | |
| 22 extern NSString* const kPageScrollStateKey; | |
| 23 extern NSString* const kScrollOffsetXKey; | |
| 24 extern NSString* const kScrollOffsetYKey; | |
| 25 extern NSString* const kMinimumZoomScaleKey; | |
| 26 extern NSString* const kMaximumZoomScaleKey; | |
| 27 extern NSString* const kZoomScaleKey; | |
| 28 | |
| 29 // Keys used to serialize navigation properties. | |
| 30 | |
| 31 // Current URL (std::string). | |
| 32 extern NSString* const kURLKey; | |
|
stuartmorgan
2015/05/07 17:19:23
These names are far too broad to be in the web nam
Eugene But (OOO till 7-30)
2015/05/07 17:43:12
Done.
| |
| 33 // Current URL. Deprecated, used for backward compatibility (NSURL). | |
| 34 extern NSString* const kURLDeperecatedKey; | |
| 35 // Page referrer URL (std::string). | |
| 36 extern NSString* const kReferrerURLKey; | |
| 37 // Page referrer URL (NSURL). Deprecated, used for backward compatibility. | |
| 38 extern NSString* const kReferrerURLDeprecatedKey; | |
| 39 // Page referrer policy (Int). | |
|
stuartmorgan
2015/05/07 17:19:23
Everywhere else you use an actual type name as it
Eugene But (OOO till 7-30)
2015/05/07 17:43:12
Done.
| |
| 40 extern NSString* const kReferrerPolicyKey; | |
| 41 // The time at which the last known local navigation has completed (Int64). | |
| 42 extern NSString* const kTimestampKey; | |
| 43 // Page title (NSString). | |
| 44 extern NSString* const kTitleKey; | |
| 45 // POST request data (NSData). | |
| 46 extern NSString* const kPOSTDataKey; | |
| 47 // HTTP request headers (NSDictionary). | |
| 48 extern NSString* const kHTTPRequestHeadersKey; | |
| 49 // Whether or not to bypass showing the resubmit data confirmation when loading | |
| 50 // a POST request (BOOL). | |
| 51 extern NSString* const kSkipResubmitConfirmationKey; | |
| 52 // Should desctop user agent be used (BOOL)? | |
|
stuartmorgan
2015/05/07 17:19:23
desktop
Eugene But (OOO till 7-30)
2015/05/07 17:43:12
Done.
| |
| 53 extern NSString* const kUseDesktopUserAgentKey; | |
| 20 } | 54 } |
| 21 | 55 |
| 22 // A CRWSessionEntry is similar to a NavigationEntry object in desktop Chrome. | 56 // A CRWSessionEntry is similar to a NavigationEntry object in desktop Chrome. |
| 23 // It maintains the information needed to save/restore a single entry in session | 57 // It maintains the information needed to save/restore a single entry in session |
| 24 // history (i.e., one site) for a tab. A tab may have multiple of these objects | 58 // history (i.e., one site) for a tab. A tab may have multiple of these objects |
| 25 // comprising its entire session history. | 59 // comprising its entire session history. |
| 26 // TODO(rohitrao): Fold CRWSessionEntry's logic into NavigationItem. | 60 // TODO(rohitrao): Fold CRWSessionEntry's logic into NavigationItem. |
| 27 @interface CRWSessionEntry : NSObject<NSCoding, NSCopying> | 61 @interface CRWSessionEntry : NSObject<NSCoding, NSCopying> |
| 28 | 62 |
| 29 @property(nonatomic, readonly) const GURL& originalUrl; | 63 @property(nonatomic, readonly) const GURL& originalUrl; |
| 30 | 64 |
| 31 // Pointer to the NavigationItem associated with this CRWSessionEntry. | 65 // Pointer to the NavigationItem associated with this CRWSessionEntry. |
| 32 // Eventually, this will replace CRWSessionEntry entirely. | 66 // Eventually, this will replace CRWSessionEntry entirely. |
| 33 @property(nonatomic, readonly) web::NavigationItem* navigationItem; | 67 @property(nonatomic, readonly) web::NavigationItem* navigationItem; |
| 34 | 68 |
| 35 // Pointer to the NavigationItemImpl associated with this CRWSessionEntry. | 69 // Pointer to the NavigationItemImpl associated with this CRWSessionEntry. |
| 36 // TODO(kkhorimoto): This is a convenience property to avoid requiring static | 70 // TODO(kkhorimoto): This is a convenience property to avoid requiring static |
| 37 // casts every time the web layer needs access to members only available in | 71 // casts every time the web layer needs access to members only available in |
| 38 // NavigationItemImpl. Remove once more navigation management moves into | 72 // NavigationItemImpl. Remove once more navigation management moves into |
| 39 // NavigationManager and CRWSessionEntry=>web::NavigationItemImpl conversions | 73 // NavigationManager and CRWSessionEntry=>web::NavigationItemImpl conversions |
| 40 // become less prominent. | 74 // become less prominent. |
| 41 @property(nonatomic, readonly) web::NavigationItemImpl* navigationItemImpl; | 75 @property(nonatomic, readonly) web::NavigationItemImpl* navigationItemImpl; |
| 42 | 76 |
| 43 // Initialize the session entry with the given NavigationItem. | 77 // Initialize the session entry with the given NavigationItem. |
| 44 - (instancetype)initWithNavigationItem:(scoped_ptr<web::NavigationItem>)item; | 78 - (instancetype)initWithNavigationItem:(scoped_ptr<web::NavigationItem>)item; |
| 45 | 79 |
| 46 @end | 80 @end |
| 47 | 81 |
| 48 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ | 82 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ |
| OLD | NEW |