| 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 #import "ios/web/navigation/crw_session_entry.h" | 5 #import "ios/web/navigation/crw_session_entry.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/mac/objc_property_releaser.h" | 9 #include "base/mac/objc_property_releaser.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
| 11 #include "ios/web/navigation/navigation_item_impl.h" | 13 #include "ios/web/navigation/navigation_item_impl.h" |
| 12 #include "ios/web/navigation/nscoder_util.h" | 14 #include "ios/web/navigation/nscoder_util.h" |
| 13 #include "ios/web/public/navigation_item.h" | 15 #include "ios/web/public/navigation_item.h" |
| 14 #include "ios/web/public/web_state/page_display_state.h" | 16 #include "ios/web/public/web_state/page_display_state.h" |
| 15 #import "net/base/mac/url_conversions.h" | 17 #import "net/base/mac/url_conversions.h" |
| 16 | 18 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 web::Referrer(GURL(referrerString), referrerPolicy)); | 110 web::Referrer(GURL(referrerString), referrerPolicy)); |
| 109 } else { | 111 } else { |
| 110 // Backward compatibility. | 112 // Backward compatibility. |
| 111 NSURL* referrer = [aDecoder | 113 NSURL* referrer = [aDecoder |
| 112 decodeObjectForKey:web::kSessionEntryReferrerURLDeprecatedKey]; | 114 decodeObjectForKey:web::kSessionEntryReferrerURLDeprecatedKey]; |
| 113 _navigationItem->SetReferrer(web::Referrer( | 115 _navigationItem->SetReferrer(web::Referrer( |
| 114 net::GURLWithNSURL(referrer), web::ReferrerPolicyDefault)); | 116 net::GURLWithNSURL(referrer), web::ReferrerPolicyDefault)); |
| 115 } | 117 } |
| 116 | 118 |
| 117 if ([aDecoder containsValueForKey:web::kSessionEntryTimestampKey]) { | 119 if ([aDecoder containsValueForKey:web::kSessionEntryTimestampKey]) { |
| 118 int64 us = [aDecoder decodeInt64ForKey:web::kSessionEntryTimestampKey]; | 120 int64_t us = [aDecoder decodeInt64ForKey:web::kSessionEntryTimestampKey]; |
| 119 _navigationItem->SetTimestamp(base::Time::FromInternalValue(us)); | 121 _navigationItem->SetTimestamp(base::Time::FromInternalValue(us)); |
| 120 } | 122 } |
| 121 | 123 |
| 122 NSString* title = [aDecoder decodeObjectForKey:web::kSessionEntryTitleKey]; | 124 NSString* title = [aDecoder decodeObjectForKey:web::kSessionEntryTitleKey]; |
| 123 // Use a transition type of reload so that we don't incorrectly increase | 125 // Use a transition type of reload so that we don't incorrectly increase |
| 124 // the typed count. This is what desktop chrome does. | 126 // the typed count. This is what desktop chrome does. |
| 125 _navigationItem->SetTitle(base::SysNSStringToUTF16(title)); | 127 _navigationItem->SetTitle(base::SysNSStringToUTF16(title)); |
| 126 _navigationItem->SetTransitionType(ui::PAGE_TRANSITION_RELOAD); | 128 _navigationItem->SetTransitionType(ui::PAGE_TRANSITION_RELOAD); |
| 127 _navigationItem->SetPageDisplayState([[self class] | 129 _navigationItem->SetPageDisplayState([[self class] |
| 128 pageDisplayStateFromDictionary: | 130 pageDisplayStateFromDictionary: |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 return | 246 return |
| 245 [NSString stringWithFormat:kPageScrollStateDescriptionFormat, | 247 [NSString stringWithFormat:kPageScrollStateDescriptionFormat, |
| 246 displayState.scroll_state().offset_x(), | 248 displayState.scroll_state().offset_x(), |
| 247 displayState.scroll_state().offset_y(), | 249 displayState.scroll_state().offset_y(), |
| 248 displayState.zoom_state().minimum_zoom_scale(), | 250 displayState.zoom_state().minimum_zoom_scale(), |
| 249 displayState.zoom_state().maximum_zoom_scale(), | 251 displayState.zoom_state().maximum_zoom_scale(), |
| 250 displayState.zoom_state().zoom_scale()]; | 252 displayState.zoom_state().zoom_scale()]; |
| 251 } | 253 } |
| 252 | 254 |
| 253 @end | 255 @end |
| OLD | NEW |