Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: ios/web/navigation/crw_session_entry.h

Issue 1132563002: CRWSessionEntry: Replaced hardcoded strings with constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolved Stuart's review comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ios/web/navigation/crw_session_entry.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 kSessionEntryPageScrollStateKey;
23 extern NSString* const kSessionEntryScrollOffsetXKey;
24 extern NSString* const kSessionEntryScrollOffsetYKey;
25 extern NSString* const kSessionEntryMinimumZoomScaleKey;
26 extern NSString* const kSessionEntryMaximumZoomScaleKey;
27 extern NSString* const kSessionEntryZoomScaleKey;
28
29 // Keys used to serialize navigation properties.
30
31 // Current URL (std::string).
32 extern NSString* const kSessionEntryURLKey;
33 // Current URL. Deprecated, used for backward compatibility (NSURL).
34 extern NSString* const kSessionEntryURLDeperecatedKey;
35 // Page referrer URL (std::string).
36 extern NSString* const kSessionEntryReferrerURLKey;
37 // Page referrer URL (NSURL). Deprecated, used for backward compatibility.
38 extern NSString* const kSessionEntryReferrerURLDeprecatedKey;
39 // Page referrer policy (int).
40 extern NSString* const kSessionEntryReferrerPolicyKey;
41 // The time at which the last known local navigation has completed (Int64).
stuartmorgan 2015/05/10 21:46:16 s/Int/int/
Eugene But (OOO till 7-30) 2015/05/11 16:54:15 Changed to int64_t
42 extern NSString* const kSessionEntryTimestampKey;
43 // Page title (NSString).
44 extern NSString* const kSessionEntryTitleKey;
45 // POST request data (NSData).
46 extern NSString* const kSessionEntryPOSTDataKey;
47 // HTTP request headers (NSDictionary).
48 extern NSString* const kSessionEntryHTTPRequestHeadersKey;
49 // Whether or not to bypass showing the resubmit data confirmation when loading
50 // a POST request (BOOL).
51 extern NSString* const kSessionEntrySkipResubmitConfirmationKey;
52 // Should desktop user agent be used (BOOL)?
53 extern NSString* const kSessionEntryUseDesktopUserAgentKey;
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_
OLDNEW
« no previous file with comments | « no previous file | ios/web/navigation/crw_session_entry.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698