OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/navigation_item_impl.h" | 5 #import "ios/web/navigation/navigation_item_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/strings/utf_string_conversions.h" |
13 #include "components/url_formatter/url_formatter.h" | 14 #include "components/url_formatter/url_formatter.h" |
14 #include "ui/base/page_transition_types.h" | 15 #include "ui/base/page_transition_types.h" |
15 #include "ui/gfx/text_elider.h" | 16 #include "ui/gfx/text_elider.h" |
16 | 17 |
17 #if !defined(__has_feature) || !__has_feature(objc_arc) | 18 #if !defined(__has_feature) || !__has_feature(objc_arc) |
18 #error "This file requires ARC support." | 19 #error "This file requires ARC support." |
19 #endif | 20 #endif |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 void NavigationItemImpl::ResetHttpRequestHeaders() { | 293 void NavigationItemImpl::ResetHttpRequestHeaders() { |
293 http_request_headers_.reset(); | 294 http_request_headers_.reset(); |
294 } | 295 } |
295 | 296 |
296 void NavigationItemImpl::ResetForCommit() { | 297 void NavigationItemImpl::ResetForCommit() { |
297 // Any state that only matters when a navigation item is pending should be | 298 // Any state that only matters when a navigation item is pending should be |
298 // cleared here. | 299 // cleared here. |
299 set_is_renderer_initiated(false); | 300 set_is_renderer_initiated(false); |
300 } | 301 } |
301 | 302 |
| 303 NSString* NavigationItemImpl::GetDescription() const { |
| 304 return [NSString |
| 305 stringWithFormat: |
| 306 @"url:%s originalurl:%s title:%s transition:%d displayState:%@ " |
| 307 @"desktopUA:%d", |
| 308 url_.spec().c_str(), original_request_url_.spec().c_str(), |
| 309 base::UTF16ToUTF8(title_).c_str(), transition_type_, |
| 310 page_display_state_.GetDescription(), is_overriding_user_agent_]; |
| 311 } |
| 312 |
302 } // namespace web | 313 } // namespace web |
OLD | NEW |