Chromium Code Reviews| 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 #ifndef COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ |
| 6 #define COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ | 6 #define COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | |
| 10 #include <memory> | 11 #include <memory> |
| 11 #include <set> | 12 #include <set> |
| 12 #include <string> | 13 #include <string> |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 17 #include "components/sessions/core/sessions_export.h" | 18 #include "components/sessions/core/sessions_export.h" |
| 18 #include "ui/base/page_transition_types.h" | 19 #include "ui/base/page_transition_types.h" |
| 19 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 | 117 |
| 117 std::set<std::string> content_pack_categories() const { | 118 std::set<std::string> content_pack_categories() const { |
| 118 return content_pack_categories_; | 119 return content_pack_categories_; |
| 119 } | 120 } |
| 120 void set_content_pack_categories( | 121 void set_content_pack_categories( |
| 121 const std::set<std::string>& content_pack_categories) { | 122 const std::set<std::string>& content_pack_categories) { |
| 122 content_pack_categories_ = content_pack_categories; | 123 content_pack_categories_ = content_pack_categories; |
| 123 } | 124 } |
| 124 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; } | 125 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; } |
| 125 | 126 |
| 127 #if !defined(OS_IOS) | |
|
sky
2016/09/29 03:08:20
I'm nervous about making this non-ios specific. Se
jianli
2016/09/29 22:02:29
Yes. Removed #if.
| |
| 128 const std::map<std::string, std::string>& extended_info_map() const { | |
| 129 return extended_info_map_; | |
| 130 } | |
| 131 #endif // !defined(OS_IOS) | |
| 132 | |
| 126 private: | 133 private: |
| 127 friend class ContentSerializedNavigationBuilder; | 134 friend class ContentSerializedNavigationBuilder; |
| 128 friend class ContentSerializedNavigationDriver; | 135 friend class ContentSerializedNavigationDriver; |
| 129 friend class SerializedNavigationEntryTestHelper; | 136 friend class SerializedNavigationEntryTestHelper; |
| 130 friend class IOSSerializedNavigationBuilder; | 137 friend class IOSSerializedNavigationBuilder; |
| 131 friend class IOSSerializedNavigationDriver; | 138 friend class IOSSerializedNavigationDriver; |
| 132 | 139 |
| 133 // Index in the NavigationController. | 140 // Index in the NavigationController. |
| 134 int index_; | 141 int index_; |
| 135 | 142 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 149 base::string16 search_terms_; | 156 base::string16 search_terms_; |
| 150 GURL favicon_url_; | 157 GURL favicon_url_; |
| 151 int http_status_code_; | 158 int http_status_code_; |
| 152 bool is_restored_; // Not persisted. | 159 bool is_restored_; // Not persisted. |
| 153 std::vector<GURL> redirect_chain_; // Not persisted. | 160 std::vector<GURL> redirect_chain_; // Not persisted. |
| 154 | 161 |
| 155 // Additional information. | 162 // Additional information. |
| 156 BlockedState blocked_state_; | 163 BlockedState blocked_state_; |
| 157 PasswordState password_state_; | 164 PasswordState password_state_; |
| 158 std::set<std::string> content_pack_categories_; | 165 std::set<std::string> content_pack_categories_; |
| 166 | |
| 167 #if !defined(OS_IOS) | |
| 168 // The map that tracks all the extended info that need to be persisted, but | |
|
sky
2016/09/29 03:08:19
How about: provides storage for arbitrary key/valu
| |
| 169 // would want to avoid the core session restore to know about the details. | |
| 170 // The consumer should implement the ExtendedInfoHandler interface and calls | |
| 171 // SerializedNavigationDriver::RegisterExtendedInfoHandler to register it. | |
| 172 // Note that all the map data are not synced since the only one added now does | |
| 173 // not need it. | |
| 174 std::map<std::string, std::string> extended_info_map_; | |
| 175 #endif // !defined(OS_IOS) | |
| 159 }; | 176 }; |
| 160 | 177 |
| 161 } // namespace sessions | 178 } // namespace sessions |
| 162 | 179 |
| 163 #endif // COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ | 180 #endif // COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ |
| OLD | NEW |