OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 // TabNavigation corresponds to the parts of NavigationEntry needed to restore | 24 // TabNavigation corresponds to the parts of NavigationEntry needed to restore |
25 // the NavigationEntry during session restore and tab restore. | 25 // the NavigationEntry during session restore and tab restore. |
26 // | 26 // |
27 // TabNavigation is cheap and supports copy semantics. | 27 // TabNavigation is cheap and supports copy semantics. |
28 class TabNavigation { | 28 class TabNavigation { |
29 public: | 29 public: |
30 enum TypeMask { | 30 enum TypeMask { |
31 HAS_POST_DATA = 1 | 31 HAS_POST_DATA = 1 |
32 }; | 32 }; |
33 | 33 |
34 TabNavigation(); | 34 TabNavigation() |
| 35 : transition_(PageTransition::TYPED), |
| 36 type_mask_(0), |
| 37 index_(-1) { |
| 38 } |
| 39 |
35 TabNavigation(int index, | 40 TabNavigation(int index, |
36 const GURL& virtual_url, | 41 const GURL& virtual_url, |
37 const GURL& referrer, | 42 const GURL& referrer, |
38 const string16& title, | 43 const string16& title, |
39 const std::string& state, | 44 const std::string& state, |
40 PageTransition::Type transition); | 45 PageTransition::Type transition) |
41 TabNavigation(const TabNavigation& tab); | 46 : virtual_url_(virtual_url), |
42 ~TabNavigation(); | 47 referrer_(referrer), |
43 TabNavigation& operator=(const TabNavigation& tab); | 48 title_(title), |
| 49 state_(state), |
| 50 transition_(transition), |
| 51 type_mask_(0), |
| 52 index_(index) {} |
44 | 53 |
45 // Converts this TabNavigation into a NavigationEntry with a page id of | 54 // Converts this TabNavigation into a NavigationEntry with a page id of |
46 // |page_id|. The caller owns the returned NavigationEntry. | 55 // |page_id|. The caller owns the returned NavigationEntry. |
47 NavigationEntry* ToNavigationEntry(int page_id, Profile* profile) const; | 56 NavigationEntry* ToNavigationEntry(int page_id, Profile* profile) const; |
48 | 57 |
49 // Resets this TabNavigation from |entry|. | 58 // Resets this TabNavigation from |entry|. |
50 void SetFromNavigationEntry(const NavigationEntry& entry); | 59 void SetFromNavigationEntry(const NavigationEntry& entry); |
51 | 60 |
52 // Virtual URL of the page. See NavigationEntry::virtual_url() for details. | 61 // Virtual URL of the page. See NavigationEntry::virtual_url() for details. |
53 void set_virtual_url(const GURL& url) { virtual_url_ = url; } | 62 void set_virtual_url(const GURL& url) { virtual_url_ = url; } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 PageTransition::Type transition_; | 100 PageTransition::Type transition_; |
92 int type_mask_; | 101 int type_mask_; |
93 | 102 |
94 int index_; | 103 int index_; |
95 }; | 104 }; |
96 | 105 |
97 // SessionTab ---------------------------------------------------------------- | 106 // SessionTab ---------------------------------------------------------------- |
98 | 107 |
99 // SessionTab corresponds to a NavigationController. | 108 // SessionTab corresponds to a NavigationController. |
100 struct SessionTab { | 109 struct SessionTab { |
101 SessionTab(); | 110 SessionTab() |
102 ~SessionTab(); | 111 : tab_visual_index(-1), |
| 112 current_navigation_index(-1), |
| 113 pinned(false) { } |
103 | 114 |
104 // Unique id of the window. | 115 // Unique id of the window. |
105 SessionID window_id; | 116 SessionID window_id; |
106 | 117 |
107 // Unique if of the tab. | 118 // Unique if of the tab. |
108 SessionID tab_id; | 119 SessionID tab_id; |
109 | 120 |
110 // Visual index of the tab within its window. There may be gaps in these | 121 // Visual index of the tab within its window. There may be gaps in these |
111 // values. | 122 // values. |
112 // | 123 // |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 ForeignSession(); | 195 ForeignSession(); |
185 ~ForeignSession(); | 196 ~ForeignSession(); |
186 | 197 |
187 // Unique tag for each session. | 198 // Unique tag for each session. |
188 std::string foreign_tession_tag; | 199 std::string foreign_tession_tag; |
189 std::vector<SessionWindow*> windows; | 200 std::vector<SessionWindow*> windows; |
190 }; | 201 }; |
191 | 202 |
192 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ | 203 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ |
193 | 204 |
OLD | NEW |