Chromium Code Reviews| 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 override_user_agent() const { return override_user_agent_; } | |
| 100 void set_override_user_agent(bool state) { override_user_agent_ = state; } | |
|
tony
2012/05/10 18:40:59
Nit: is_overriding_user_agent/set_is_overriding_us
gone
2012/05/11 15:40:30
Done.
| |
| 101 | |
| 98 // Converts a set of TabNavigations into a set of NavigationEntrys. The | 102 // Converts a set of TabNavigations into a set of NavigationEntrys. The |
| 99 // caller owns the NavigationEntrys. | 103 // caller owns the NavigationEntrys. |
| 100 static void CreateNavigationEntriesFromTabNavigations( | 104 static void CreateNavigationEntriesFromTabNavigations( |
| 101 Profile* profile, | 105 Profile* profile, |
| 102 const std::vector<TabNavigation>& navigations, | 106 const std::vector<TabNavigation>& navigations, |
| 103 std::vector<content::NavigationEntry*>* entries); | 107 std::vector<content::NavigationEntry*>* entries); |
| 104 | 108 |
| 105 private: | 109 private: |
| 106 friend class BaseSessionService; | 110 friend class BaseSessionService; |
| 107 | 111 |
| 108 GURL virtual_url_; | 112 GURL virtual_url_; |
| 109 content::Referrer referrer_; | 113 content::Referrer referrer_; |
| 110 string16 title_; | 114 string16 title_; |
| 111 std::string state_; | 115 std::string state_; |
| 112 content::PageTransition transition_; | 116 content::PageTransition transition_; |
| 113 int type_mask_; | 117 int type_mask_; |
| 114 int64 post_id_; | 118 int64 post_id_; |
| 115 | 119 |
| 116 int index_; | 120 int index_; |
| 117 GURL original_request_url_; | 121 GURL original_request_url_; |
| 122 bool override_user_agent_; | |
|
tony
2012/05/10 18:40:59
Nit: is_overriding_user_agent?
gone
2012/05/11 15:40:30
Done.
| |
| 118 }; | 123 }; |
| 119 | 124 |
| 120 // SessionTab ---------------------------------------------------------------- | 125 // SessionTab ---------------------------------------------------------------- |
| 121 | 126 |
| 122 // SessionTab corresponds to a NavigationController. | 127 // SessionTab corresponds to a NavigationController. |
| 123 struct SessionTab { | 128 struct SessionTab { |
| 124 SessionTab(); | 129 SessionTab(); |
| 125 ~SessionTab(); | 130 ~SessionTab(); |
| 126 | 131 |
| 127 // Unique id of the window. | 132 // 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 | 154 // only valid url's being stored (ie chrome://newtab is not stored). Bounds |
| 150 // checking must be performed before indexing into |navigations|. | 155 // checking must be performed before indexing into |navigations|. |
| 151 int current_navigation_index; | 156 int current_navigation_index; |
| 152 | 157 |
| 153 // True if the tab is pinned. | 158 // True if the tab is pinned. |
| 154 bool pinned; | 159 bool pinned; |
| 155 | 160 |
| 156 // If non-empty, this tab is an app tab and this is the id of the extension. | 161 // If non-empty, this tab is an app tab and this is the id of the extension. |
| 157 std::string extension_app_id; | 162 std::string extension_app_id; |
| 158 | 163 |
| 164 // If non-empty, this string is used as the user agent whenever the tab's | |
| 165 // NavigationEntries need it overridden. | |
| 166 std::string user_agent_override; | |
| 167 | |
| 159 // Timestamp for when this tab was last modified. | 168 // Timestamp for when this tab was last modified. |
| 160 base::Time timestamp; | 169 base::Time timestamp; |
| 161 | 170 |
| 162 std::vector<TabNavigation> navigations; | 171 std::vector<TabNavigation> navigations; |
| 163 | 172 |
| 164 private: | 173 private: |
| 165 DISALLOW_COPY_AND_ASSIGN(SessionTab); | 174 DISALLOW_COPY_AND_ASSIGN(SessionTab); |
| 166 }; | 175 }; |
| 167 | 176 |
| 168 // SessionWindow ------------------------------------------------------------- | 177 // SessionWindow ------------------------------------------------------------- |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 // Is the window maximized, minimized, or normal? | 216 // Is the window maximized, minimized, or normal? |
| 208 ui::WindowShowState show_state; | 217 ui::WindowShowState show_state; |
| 209 | 218 |
| 210 std::string app_name; | 219 std::string app_name; |
| 211 | 220 |
| 212 private: | 221 private: |
| 213 DISALLOW_COPY_AND_ASSIGN(SessionWindow); | 222 DISALLOW_COPY_AND_ASSIGN(SessionWindow); |
| 214 }; | 223 }; |
| 215 | 224 |
| 216 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ | 225 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ |
| OLD | NEW |