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