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 "components/sessions/content/content_serialized_navigation_driver.h" | 5 #include "components/sessions/content/content_serialized_navigation_driver.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "components/sessions/core/serialized_navigation_entry.h" | 9 #include "components/sessions/core/serialized_navigation_entry.h" |
10 #include "content/public/common/page_state.h" | 10 #include "content/public/common/page_state.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 #endif // defined(OS_ANDROID) | 126 #endif // defined(OS_ANDROID) |
127 } | 127 } |
128 | 128 |
129 std::string ContentSerializedNavigationDriver::StripReferrerFromPageState( | 129 std::string ContentSerializedNavigationDriver::StripReferrerFromPageState( |
130 const std::string& page_state) const { | 130 const std::string& page_state) const { |
131 return content::PageState::CreateFromEncodedData(page_state) | 131 return content::PageState::CreateFromEncodedData(page_state) |
132 .RemoveReferrer() | 132 .RemoveReferrer() |
133 .ToEncodedData(); | 133 .ToEncodedData(); |
134 } | 134 } |
135 | 135 |
| 136 void ContentSerializedNavigationDriver::RegisterExtendedInfoHandler( |
| 137 const std::string& key, |
| 138 std::unique_ptr<ExtendedInfoHandler> handler) { |
| 139 DCHECK(!key.empty()); |
| 140 extended_info_handler_map_[key] = std::move(handler); |
| 141 } |
| 142 |
| 143 const SerializedNavigationDriver::ExtendedInfoHandlerMap& |
| 144 ContentSerializedNavigationDriver::GetAllExtendedInfoHandlers() const { |
| 145 return extended_info_handler_map_; |
| 146 } |
| 147 |
136 } // namespace sessions | 148 } // namespace sessions |
OLD | NEW |