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> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // TODO(ios): Shall we overwrite EqualTo:? | 43 // TODO(ios): Shall we overwrite EqualTo:? |
44 | 44 |
45 - (instancetype)copyWithZone:(NSZone*)zone { | 45 - (instancetype)copyWithZone:(NSZone*)zone { |
46 CRWSessionEntry* copy = [[[self class] alloc] init]; | 46 CRWSessionEntry* copy = [[[self class] alloc] init]; |
47 copy->_navigationItem.reset( | 47 copy->_navigationItem.reset( |
48 new web::NavigationItemImpl(*_navigationItem.get())); | 48 new web::NavigationItemImpl(*_navigationItem.get())); |
49 return copy; | 49 return copy; |
50 } | 50 } |
51 | 51 |
52 - (NSString*)description { | 52 - (NSString*)description { |
53 return [NSString | 53 #ifndef NDEBUG |
54 stringWithFormat: | 54 return _navigationItem->GetDescription(); |
55 @"url:%@ originalurl:%@ title:%@ transition:%d displayState:%@ " | 55 #else |
56 @"userAgentType:%s", | 56 return [super description]; |
57 base::SysUTF8ToNSString(_navigationItem->GetURL().spec()), | 57 #endif |
58 base::SysUTF8ToNSString( | |
59 _navigationItem->GetOriginalRequestURL().spec()), | |
60 base::SysUTF16ToNSString(_navigationItem->GetTitle()), | |
61 _navigationItem->GetTransitionType(), | |
62 _navigationItem->GetPageDisplayState().GetDescription(), | |
63 web::GetUserAgentTypeDescription(_navigationItem->GetUserAgentType()) | |
64 .c_str()]; | |
65 } | 58 } |
66 | 59 |
67 - (web::NavigationItem*)navigationItem { | 60 - (web::NavigationItem*)navigationItem { |
68 return _navigationItem.get(); | 61 return _navigationItem.get(); |
69 } | 62 } |
70 | 63 |
71 - (web::NavigationItemImpl*)navigationItemImpl { | 64 - (web::NavigationItemImpl*)navigationItemImpl { |
72 return _navigationItem.get(); | 65 return _navigationItem.get(); |
73 } | 66 } |
74 | 67 |
75 @end | 68 @end |
OLD | NEW |