Index: ios/web/public/crw_navigation_item_storage.h |
diff --git a/ios/web/public/crw_navigation_item_storage.h b/ios/web/public/crw_navigation_item_storage.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fe30fb2b753f56a169c58ec80485d9308fd38fa6 |
--- /dev/null |
+++ b/ios/web/public/crw_navigation_item_storage.h |
@@ -0,0 +1,80 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef IOS_WEB_PUBLIC_CRW_NAVIGATION_ITEM_STORAGE_H_ |
+#define IOS_WEB_PUBLIC_CRW_NAVIGATION_ITEM_STORAGE_H_ |
+ |
+#import <Foundation/Foundation.h> |
+#include <stddef.h> |
+ |
+#include "base/strings/string16.h" |
+#include "base/time/time.h" |
+#include "ios/web/public/referrer.h" |
+#include "ios/web/public/web_state/page_display_state.h" |
+#include "url/gurl.h" |
+ |
+namespace web { |
+ |
+// Keys used to serialize web::PageDisplayState properties. |
+extern NSString* const kNavigationItemStoragePageDisplayStateKey; |
+extern NSString* const kNavigationItemStorageScrollOffsetXKey; |
+extern NSString* const kNavigationItemStorageScrollOffsetYKey; |
+extern NSString* const kNavigationItemStorageMinimumZoomScaleKey; |
+extern NSString* const kNavigationItemStorageMaximumZoomScaleKey; |
+extern NSString* const kNavigationItemStorageZoomScaleKey; |
+ |
+// Keys used to serialize navigation properties. |
+ |
+// Current URL (std::string). |
+extern NSString* const kNavigationItemStorageURLKey; |
+// Current URL. Deprecated, used for backward compatibility (NSURL). |
+extern NSString* const kNavigationItemStorageURLDeperecatedKey; |
+// Page referrer URL (std::string). |
+extern NSString* const kNavigationItemStorageReferrerURLKey; |
+// Page referrer URL (NSURL). Deprecated, used for backward compatibility. |
+extern NSString* const kNavigationItemStorageReferrerURLDeprecatedKey; |
+// Page referrer policy (int). |
+extern NSString* const kNavigationItemStorageReferrerPolicyKey; |
+// The time at which the last known local navigation has completed (int64_t). |
+extern NSString* const kNavigationItemStorageTimestampKey; |
+// Page title (NSString). |
+extern NSString* const kNavigationItemStorageTitleKey; |
+// POST request data (NSData). |
+extern NSString* const kNavigationItemStoragePOSTDataKey; |
+// HTTP request headers (NSDictionary). |
+extern NSString* const kNavigationItemStorageHTTPRequestHeadersKey; |
+// Whether or not to bypass showing the resubmit data confirmation when loading |
+// a POST request (BOOL). |
+extern NSString* const kNavigationItemStorageSkipRepostFormConfirmationKey; |
+// Should desktop user agent be used (BOOL)? |
+extern NSString* const kNavigationItemStorageUseDesktopUserAgentKey; |
+ |
+} // namespace web |
+ |
+// NSCoding-compliant class used to serialize NavigationItem's persisted |
+// properties. |
+@interface CRWNavigationItemStorage : NSObject<NSCoding> |
+ |
+@property(nonatomic, assign) GURL virtualURL; |
+@property(nonatomic, assign) web::Referrer referrer; |
+@property(nonatomic, assign) base::Time timestamp; |
+@property(nonatomic, assign) base::string16 title; |
+@property(nonatomic, assign) web::PageDisplayState displayState; |
+@property(nonatomic, assign) BOOL shouldSkipRepostFormConfirmation; |
+@property(nonatomic, assign, getter=isOverridingUserAgent) |
+ BOOL overridingUserAgent; |
+@property(nonatomic, copy) NSData* POSTData; |
+@property(nonatomic, copy) NSDictionary* HTTPRequestHeaders; |
+ |
+@end |
+ |
+// Exposes serialization helper functions for tests. |
Eugene But (OOO till 7-30)
2017/01/31 22:12:26
From Google Testing Dev Guide: "Test code using re
kkhorimoto
2017/02/03 00:36:09
Helpers moved to PageDisplayState.
|
+@interface CRWNavigationItemStorage (Testing) |
+ |
++ (web::PageDisplayState)displayStateFromDictionary:(NSDictionary*)dictionary; |
++ (NSDictionary*)dictionaryFromDisplayState:(web::PageDisplayState)displayState; |
+ |
+@end |
+ |
+#endif // IOS_WEB_PUBLIC_CRW_NAVIGATION_ITEM_STORAGE_H_ |