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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // by BaseSessionService and SessionService. | 88 // by BaseSessionService and SessionService. |
89 void set_index(int index) { index_ = index; } | 89 void set_index(int index) { index_ = index; } |
90 int index() const { return index_; } | 90 int index() const { return index_; } |
91 | 91 |
92 // The URL that initially spawned the NavigationEntry. | 92 // The URL that initially spawned the NavigationEntry. |
93 const GURL& original_request_url() const { return original_request_url_; } | 93 const GURL& original_request_url() const { return original_request_url_; } |
94 void set_original_request_url(const GURL& url) { | 94 void set_original_request_url(const GURL& url) { |
95 original_request_url_ = url; | 95 original_request_url_ = url; |
96 } | 96 } |
97 | 97 |
| 98 // Whether or not we're overriding the standard user agent. |
| 99 bool is_overriding_user_agent() const { return is_overriding_user_agent_; } |
| 100 void set_is_overriding_user_agent(bool state) { |
| 101 is_overriding_user_agent_ = state; |
| 102 } |
| 103 |
98 // Converts a set of TabNavigations into a set of NavigationEntrys. The | 104 // Converts a set of TabNavigations into a set of NavigationEntrys. The |
99 // caller owns the NavigationEntrys. | 105 // caller owns the NavigationEntrys. |
100 static void CreateNavigationEntriesFromTabNavigations( | 106 static void CreateNavigationEntriesFromTabNavigations( |
101 Profile* profile, | 107 Profile* profile, |
102 const std::vector<TabNavigation>& navigations, | 108 const std::vector<TabNavigation>& navigations, |
103 std::vector<content::NavigationEntry*>* entries); | 109 std::vector<content::NavigationEntry*>* entries); |
104 | 110 |
105 private: | 111 private: |
106 friend class BaseSessionService; | 112 friend class BaseSessionService; |
107 | 113 |
108 GURL virtual_url_; | 114 GURL virtual_url_; |
109 content::Referrer referrer_; | 115 content::Referrer referrer_; |
110 string16 title_; | 116 string16 title_; |
111 std::string state_; | 117 std::string state_; |
112 content::PageTransition transition_; | 118 content::PageTransition transition_; |
113 int type_mask_; | 119 int type_mask_; |
114 int64 post_id_; | 120 int64 post_id_; |
115 | 121 |
116 int index_; | 122 int index_; |
117 GURL original_request_url_; | 123 GURL original_request_url_; |
| 124 bool is_overriding_user_agent_; |
118 }; | 125 }; |
119 | 126 |
120 // SessionTab ---------------------------------------------------------------- | 127 // SessionTab ---------------------------------------------------------------- |
121 | 128 |
122 // SessionTab corresponds to a NavigationController. | 129 // SessionTab corresponds to a NavigationController. |
123 struct SessionTab { | 130 struct SessionTab { |
124 SessionTab(); | 131 SessionTab(); |
125 virtual ~SessionTab(); | 132 virtual ~SessionTab(); |
126 | 133 |
127 // Unique id of the window. | 134 // Unique id of the window. |
(...skipping 21 matching lines...) Expand all Loading... |
149 // only valid url's being stored (ie chrome://newtab is not stored). Bounds | 156 // only valid url's being stored (ie chrome://newtab is not stored). Bounds |
150 // checking must be performed before indexing into |navigations|. | 157 // checking must be performed before indexing into |navigations|. |
151 int current_navigation_index; | 158 int current_navigation_index; |
152 | 159 |
153 // True if the tab is pinned. | 160 // True if the tab is pinned. |
154 bool pinned; | 161 bool pinned; |
155 | 162 |
156 // If non-empty, this tab is an app tab and this is the id of the extension. | 163 // If non-empty, this tab is an app tab and this is the id of the extension. |
157 std::string extension_app_id; | 164 std::string extension_app_id; |
158 | 165 |
| 166 // If non-empty, this string is used as the user agent whenever the tab's |
| 167 // NavigationEntries need it overridden. |
| 168 std::string user_agent_override; |
| 169 |
159 // Timestamp for when this tab was last modified. | 170 // Timestamp for when this tab was last modified. |
160 base::Time timestamp; | 171 base::Time timestamp; |
161 | 172 |
162 std::vector<TabNavigation> navigations; | 173 std::vector<TabNavigation> navigations; |
163 | 174 |
164 private: | 175 private: |
165 DISALLOW_COPY_AND_ASSIGN(SessionTab); | 176 DISALLOW_COPY_AND_ASSIGN(SessionTab); |
166 }; | 177 }; |
167 | 178 |
168 // SessionWindow ------------------------------------------------------------- | 179 // SessionWindow ------------------------------------------------------------- |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Is the window maximized, minimized, or normal? | 218 // Is the window maximized, minimized, or normal? |
208 ui::WindowShowState show_state; | 219 ui::WindowShowState show_state; |
209 | 220 |
210 std::string app_name; | 221 std::string app_name; |
211 | 222 |
212 private: | 223 private: |
213 DISALLOW_COPY_AND_ASSIGN(SessionWindow); | 224 DISALLOW_COPY_AND_ASSIGN(SessionWindow); |
214 }; | 225 }; |
215 | 226 |
216 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ | 227 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ |
OLD | NEW |