OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ |
6 #define CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ | 6 #define CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // used by SessionService. | 81 // used by SessionService. |
82 int index() const { return index_; } | 82 int index() const { return index_; } |
83 void set_index(int index) { index_ = index; } | 83 void set_index(int index) { index_ = index; } |
84 | 84 |
85 // Accessors for some fields taken from NavigationEntry. | 85 // Accessors for some fields taken from NavigationEntry. |
86 int unique_id() const { return unique_id_; } | 86 int unique_id() const { return unique_id_; } |
87 const GURL& virtual_url() const { return virtual_url_; } | 87 const GURL& virtual_url() const { return virtual_url_; } |
88 const string16& title() const { return title_; } | 88 const string16& title() const { return title_; } |
89 const std::string& content_state() const { return content_state_; } | 89 const std::string& content_state() const { return content_state_; } |
90 | 90 |
91 // Timestamp this navigation occurred. | |
92 base::Time timestamp() const { return timestamp_; } | |
93 | |
94 // Converts a set of TabNavigations into a list of NavigationEntrys | 91 // Converts a set of TabNavigations into a list of NavigationEntrys |
95 // with sequential page IDs and the given context. The caller owns | 92 // with sequential page IDs and the given context. The caller owns |
96 // the returned NavigationEntrys. | 93 // the returned NavigationEntrys. |
97 static std::vector<content::NavigationEntry*> | 94 static std::vector<content::NavigationEntry*> |
98 CreateNavigationEntriesFromTabNavigations( | 95 CreateNavigationEntriesFromTabNavigations( |
99 const std::vector<TabNavigation>& navigations, | 96 const std::vector<TabNavigation>& navigations, |
100 content::BrowserContext* browser_context); | 97 content::BrowserContext* browser_context); |
101 | 98 |
102 private: | 99 private: |
103 friend struct SessionTypesTestHelper; | 100 friend struct SessionTypesTestHelper; |
104 | 101 |
105 // Index in the NavigationController. | 102 // Index in the NavigationController. |
106 int index_; | 103 int index_; |
107 | 104 |
108 // Member variables corresponding to NavigationEntry fields. | 105 // Member variables corresponding to NavigationEntry fields. |
109 int unique_id_; | 106 int unique_id_; |
110 content::Referrer referrer_; | 107 content::Referrer referrer_; |
111 GURL virtual_url_; | 108 GURL virtual_url_; |
112 string16 title_; | 109 string16 title_; |
113 std::string content_state_; | 110 std::string content_state_; |
114 content::PageTransition transition_type_; | 111 content::PageTransition transition_type_; |
115 bool has_post_data_; | 112 bool has_post_data_; |
116 int64 post_id_; | 113 int64 post_id_; |
117 GURL original_request_url_; | 114 GURL original_request_url_; |
118 bool is_overriding_user_agent_; | 115 bool is_overriding_user_agent_; |
119 base::Time timestamp_; | 116 base::Time timestamp_; |
| 117 int http_status_code_; |
120 }; | 118 }; |
121 | 119 |
122 // SessionTab ---------------------------------------------------------------- | 120 // SessionTab ---------------------------------------------------------------- |
123 | 121 |
124 // SessionTab corresponds to a NavigationController. | 122 // SessionTab corresponds to a NavigationController. |
125 struct SessionTab { | 123 struct SessionTab { |
126 SessionTab(); | 124 SessionTab(); |
127 ~SessionTab(); | 125 ~SessionTab(); |
128 | 126 |
129 // Since the current_navigation_index can be larger than the index for number | 127 // Since the current_navigation_index can be larger than the index for number |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // Is the window maximized, minimized, or normal? | 237 // Is the window maximized, minimized, or normal? |
240 ui::WindowShowState show_state; | 238 ui::WindowShowState show_state; |
241 | 239 |
242 std::string app_name; | 240 std::string app_name; |
243 | 241 |
244 private: | 242 private: |
245 DISALLOW_COPY_AND_ASSIGN(SessionWindow); | 243 DISALLOW_COPY_AND_ASSIGN(SessionWindow); |
246 }; | 244 }; |
247 | 245 |
248 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ | 246 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ |
OLD | NEW |