Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: components/sessions/core/serialized_navigation_entry.h

Issue 2759333002: Move chrome-specific SerializedNavigation code to chrome/. (Closed)
Patch Set: Fix Android Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <map>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // fields. 81 // fields.
82 sync_pb::TabNavigation ToSyncData() const; 82 sync_pb::TabNavigation ToSyncData() const;
83 83
84 // The index in the NavigationController. This SerializedNavigationEntry is 84 // The index in the NavigationController. This SerializedNavigationEntry is
85 // valid only when the index is non-negative. 85 // valid only when the index is non-negative.
86 int index() const { return index_; } 86 int index() const { return index_; }
87 void set_index(int index) { index_ = index; } 87 void set_index(int index) { index_ = index; }
88 88
89 // Accessors for some fields taken from NavigationEntry. 89 // Accessors for some fields taken from NavigationEntry.
90 int unique_id() const { return unique_id_; } 90 int unique_id() const { return unique_id_; }
91 const GURL& virtual_url() const { return virtual_url_; }
92 const base::string16& title() const { return title_; } 91 const base::string16& title() const { return title_; }
93 const std::string& encoded_page_state() const { return encoded_page_state_; }
94 const base::string16& search_terms() const { return search_terms_; } 92 const base::string16& search_terms() const { return search_terms_; }
95 const GURL& favicon_url() const { return favicon_url_; } 93 const GURL& favicon_url() const { return favicon_url_; }
96 int http_status_code() const { return http_status_code_; } 94 int http_status_code() const { return http_status_code_; }
97 const GURL& referrer_url() const { return referrer_url_; }
98 int referrer_policy() const { return referrer_policy_; }
99 ui::PageTransition transition_type() const { 95 ui::PageTransition transition_type() const {
100 return transition_type_; 96 return transition_type_;
101 } 97 }
102 bool has_post_data() const { return has_post_data_; } 98 bool has_post_data() const { return has_post_data_; }
103 int64_t post_id() const { return post_id_; } 99 int64_t post_id() const { return post_id_; }
104 const GURL& original_request_url() const { return original_request_url_; }
105 bool is_overriding_user_agent() const { return is_overriding_user_agent_; } 100 bool is_overriding_user_agent() const { return is_overriding_user_agent_; }
106 base::Time timestamp() const { return timestamp_; } 101 base::Time timestamp() const { return timestamp_; }
107 102
108 BlockedState blocked_state() const { return blocked_state_; } 103 BlockedState blocked_state() const { return blocked_state_; }
109 void set_blocked_state(BlockedState blocked_state) { 104 void set_blocked_state(BlockedState blocked_state) {
110 blocked_state_ = blocked_state; 105 blocked_state_ = blocked_state;
111 } 106 }
112 107
113 PasswordState password_state() const { return password_state_; } 108 PasswordState password_state() const { return password_state_; }
114 void set_password_state(PasswordState password_state) { 109 void set_password_state(PasswordState password_state) {
115 password_state_ = password_state; 110 password_state_ = password_state;
116 } 111 }
117 112
113 const GURL& virtual_url() const { return virtual_url_; }
114 void set_virtual_url(const GURL& virtual_url) { virtual_url_ = virtual_url; }
115
116 const std::string& encoded_page_state() const { return encoded_page_state_; }
117 void set_encoded_page_state(const std::string& encoded_page_state) {
118 encoded_page_state_ = encoded_page_state;
119 }
120
121 const GURL& original_request_url() const { return original_request_url_; }
122 void set_original_request_url(const GURL& original_request_url) {
123 original_request_url_ = original_request_url;
124 }
125
126 const GURL& referrer_url() const { return referrer_url_; }
127 void set_referrer_url(const GURL& referrer_url) {
128 referrer_url_ = referrer_url;
129 }
130
131 int referrer_policy() const { return referrer_policy_; }
132 void set_referrer_policy(int referrer_policy) {
133 referrer_policy_ = referrer_policy;
134 }
135
118 std::set<std::string> content_pack_categories() const { 136 std::set<std::string> content_pack_categories() const {
119 return content_pack_categories_; 137 return content_pack_categories_;
120 } 138 }
121 void set_content_pack_categories( 139 void set_content_pack_categories(
122 const std::set<std::string>& content_pack_categories) { 140 const std::set<std::string>& content_pack_categories) {
123 content_pack_categories_ = content_pack_categories; 141 content_pack_categories_ = content_pack_categories;
124 } 142 }
125 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; } 143 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; }
126 144
127 const std::map<std::string, std::string>& extended_info_map() const { 145 const std::map<std::string, std::string>& extended_info_map() const {
128 return extended_info_map_; 146 return extended_info_map_;
129 } 147 }
130 148
131 size_t EstimateMemoryUsage() const; 149 size_t EstimateMemoryUsage() const;
132 150
133 private: 151 private:
134 friend class ContentSerializedNavigationBuilder; 152 friend class ContentSerializedNavigationBuilder;
135 friend class ContentSerializedNavigationDriver;
136 friend class SerializedNavigationEntryTestHelper; 153 friend class SerializedNavigationEntryTestHelper;
137 friend class IOSSerializedNavigationBuilder; 154 friend class IOSSerializedNavigationBuilder;
138 friend class IOSSerializedNavigationDriver; 155 friend class IOSSerializedNavigationDriver;
139 156
140 // Index in the NavigationController. 157 // Index in the NavigationController.
141 int index_; 158 int index_;
142 159
143 // Member variables corresponding to NavigationEntry fields. 160 // Member variables corresponding to NavigationEntry fields.
144 // If you add a new field that can allocate memory, please also add 161 // If you add a new field that can allocate memory, please also add
145 // it to the EstimatedMemoryUsage() implementation. 162 // it to the EstimatedMemoryUsage() implementation.
(...skipping 21 matching lines...) Expand all
167 std::set<std::string> content_pack_categories_; 184 std::set<std::string> content_pack_categories_;
168 185
169 // Provides storage for arbitrary key/value pairs used by features. This 186 // Provides storage for arbitrary key/value pairs used by features. This
170 // data is not synced. 187 // data is not synced.
171 std::map<std::string, std::string> extended_info_map_; 188 std::map<std::string, std::string> extended_info_map_;
172 }; 189 };
173 190
174 } // namespace sessions 191 } // namespace sessions
175 192
176 #endif // COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_ 193 #endif // COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_ENTRY_H_
OLDNEW
« no previous file with comments | « components/sessions/core/serialized_navigation_driver.h ('k') | content/public/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698