Index: ios/web/public/web_state/page_display_state.h |
diff --git a/ios/web/public/web_state/page_display_state.h b/ios/web/public/web_state/page_display_state.h |
index a9e8802092d56cce1ad84de47c218226f22a4a46..19fd0638aed31e5160edfc71e0a9dd6955269a58 100644 |
--- a/ios/web/public/web_state/page_display_state.h |
+++ b/ios/web/public/web_state/page_display_state.h |
@@ -5,6 +5,8 @@ |
#ifndef IOS_WEB_PUBLIC_WEB_STATE_PAGE_DISPLAY_STATE_H_ |
#define IOS_WEB_PUBLIC_WEB_STATE_PAGE_DISPLAY_STATE_H_ |
+#import <Foundation/Foundation.h> |
Eugene But (OOO till 7-30)
2017/02/03 01:52:34
This changes the header to Objective-C, so please
kkhorimoto
2017/02/03 02:47:23
Done.
|
+ |
namespace web { |
// Class used to represent the scrolling offset of a webview. |
@@ -29,6 +31,10 @@ class PageScrollState { |
bool operator==(const PageScrollState& other) const; |
bool operator!=(const PageScrollState& other) const; |
+ // Serialization keys. |
+ static NSString* XOffsetKey(); |
Eugene But (OOO till 7-30)
2017/02/03 01:52:34
Should these keys be constants, like all other key
kkhorimoto
2017/02/03 02:47:23
Done.
|
+ static NSString* YOffsetKey(); |
+ |
private: |
// The x value of the page's UIScrollView contentOffset. |
double offset_x_; |
@@ -74,6 +80,11 @@ class PageZoomState { |
bool operator==(const PageZoomState& other) const; |
bool operator!=(const PageZoomState& other) const; |
+ // Serialization keys. |
+ static NSString* MinZoomKey(); |
+ static NSString* MaxZoomKey(); |
+ static NSString* ZoomKey(); |
+ |
private: |
// The minimumZoomScale value of the page's UIScrollView. |
double minimum_zoom_scale_; |
@@ -96,6 +107,7 @@ class PageDisplayState { |
double minimum_zoom_scale, |
double maximum_zoom_scale, |
double zoom_scale); |
+ PageDisplayState(NSDictionary* serialization); |
~PageDisplayState(); |
// PageScrollStates cannot be applied until the scroll offset and zoom scale |
@@ -118,6 +130,12 @@ class PageDisplayState { |
bool operator==(const PageDisplayState& other) const; |
bool operator!=(const PageDisplayState& other) const; |
+ // Returns a serialized representation of the PageDisplayState. |
+ NSDictionary* GetSerialization() const; |
Eugene But (OOO till 7-30)
2017/02/03 01:52:34
Could you please add tests for these new functions
kkhorimoto
2017/02/03 02:47:23
Done.
|
+ |
+ // Returns a description string for the PageDisplayState. |
+ NSString* GetDescription() const; |
+ |
private: |
// The scroll state for the page's UIScrollView. |
PageScrollState scroll_state_; |