OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/serialized_navigation_entry.h" | 5 #include "components/sessions/serialized_navigation_entry.h" |
6 | 6 |
7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/public/browser/favicon_status.h" | 9 #include "content/public/browser/favicon_status.h" |
10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 navigation.transition_type_ = | 143 navigation.transition_type_ = |
144 static_cast<content::PageTransition>(transition); | 144 static_cast<content::PageTransition>(transition); |
145 | 145 |
146 navigation.timestamp_ = base::Time(); | 146 navigation.timestamp_ = base::Time(); |
147 navigation.search_terms_ = base::UTF8ToUTF16(sync_data.search_terms()); | 147 navigation.search_terms_ = base::UTF8ToUTF16(sync_data.search_terms()); |
148 if (sync_data.has_favicon_url()) | 148 if (sync_data.has_favicon_url()) |
149 navigation.favicon_url_ = GURL(sync_data.favicon_url()); | 149 navigation.favicon_url_ = GURL(sync_data.favicon_url()); |
150 | 150 |
151 navigation.http_status_code_ = sync_data.http_status_code(); | 151 navigation.http_status_code_ = sync_data.http_status_code(); |
152 | 152 |
153 // We shouldn't sync session data for managed users down at the moment. | |
154 DCHECK(!sync_data.has_blocked_state()); | |
155 DCHECK_EQ(0, sync_data.content_pack_categories_size()); | |
156 | |
157 navigation.Sanitize(); | 153 navigation.Sanitize(); |
158 | 154 |
159 navigation.is_restored_ = true; | 155 navigation.is_restored_ = true; |
160 | 156 |
161 return navigation; | 157 return navigation; |
162 } | 158 } |
163 | 159 |
164 namespace { | 160 namespace { |
165 | 161 |
166 // Helper used by SerializedNavigationEntry::WriteToPickle(). It writes |str| to | 162 // Helper used by SerializedNavigationEntry::WriteToPickle(). It writes |str| to |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } | 537 } |
542 | 538 |
543 if (referrer_.url != old_referrer.url || | 539 if (referrer_.url != old_referrer.url || |
544 referrer_.policy != old_referrer.policy) { | 540 referrer_.policy != old_referrer.policy) { |
545 referrer_ = content::Referrer(); | 541 referrer_ = content::Referrer(); |
546 page_state_ = page_state_.RemoveReferrer(); | 542 page_state_ = page_state_.RemoveReferrer(); |
547 } | 543 } |
548 } | 544 } |
549 | 545 |
550 } // namespace sessions | 546 } // namespace sessions |
OLD | NEW |