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 #include "ios/web/navigation/navigation_item_impl.h" | 5 #include "ios/web/navigation/navigation_item_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
| 9 #include <utility> |
| 10 |
9 #include "base/logging.h" | 11 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
11 #include "components/url_formatter/url_formatter.h" | 13 #include "components/url_formatter/url_formatter.h" |
12 #include "ui/base/page_transition_types.h" | 14 #include "ui/base/page_transition_types.h" |
13 #include "ui/gfx/text_elider.h" | 15 #include "ui/gfx/text_elider.h" |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 // Returns a new unique ID for use in NavigationItem during construction. The | 19 // Returns a new unique ID for use in NavigationItem during construction. The |
18 // returned ID is guaranteed to be nonzero (which is the "no ID" indicator). | 20 // returned ID is guaranteed to be nonzero (which is the "no ID" indicator). |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 item.should_skip_resubmit_data_confirmation_), | 65 item.should_skip_resubmit_data_confirmation_), |
64 post_data_([item.post_data_ copy]), | 66 post_data_([item.post_data_ copy]), |
65 is_renderer_initiated_(item.is_renderer_initiated_), | 67 is_renderer_initiated_(item.is_renderer_initiated_), |
66 is_unsafe_(item.is_unsafe_), | 68 is_unsafe_(item.is_unsafe_), |
67 cached_display_title_(item.cached_display_title_), | 69 cached_display_title_(item.cached_display_title_), |
68 facade_delegate_(nullptr) { | 70 facade_delegate_(nullptr) { |
69 } | 71 } |
70 | 72 |
71 void NavigationItemImpl::SetFacadeDelegate( | 73 void NavigationItemImpl::SetFacadeDelegate( |
72 scoped_ptr<NavigationItemFacadeDelegate> facade_delegate) { | 74 scoped_ptr<NavigationItemFacadeDelegate> facade_delegate) { |
73 facade_delegate_ = facade_delegate.Pass(); | 75 facade_delegate_ = std::move(facade_delegate); |
74 } | 76 } |
75 | 77 |
76 NavigationItemFacadeDelegate* NavigationItemImpl::GetFacadeDelegate() const { | 78 NavigationItemFacadeDelegate* NavigationItemImpl::GetFacadeDelegate() const { |
77 return facade_delegate_.get(); | 79 return facade_delegate_.get(); |
78 } | 80 } |
79 | 81 |
80 int NavigationItemImpl::GetUniqueID() const { | 82 int NavigationItemImpl::GetUniqueID() const { |
81 return unique_id_; | 83 return unique_id_; |
82 } | 84 } |
83 | 85 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 http_request_headers_.reset(); | 271 http_request_headers_.reset(); |
270 } | 272 } |
271 | 273 |
272 void NavigationItemImpl::ResetForCommit() { | 274 void NavigationItemImpl::ResetForCommit() { |
273 // Any state that only matters when a navigation item is pending should be | 275 // Any state that only matters when a navigation item is pending should be |
274 // cleared here. | 276 // cleared here. |
275 set_is_renderer_initiated(false); | 277 set_is_renderer_initiated(false); |
276 } | 278 } |
277 | 279 |
278 } // namespace web | 280 } // namespace web |
OLD | NEW |