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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // This is used when determining the selected TabNavigation and only | 80 // This is used when determining the selected TabNavigation and only |
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 const string16& search_terms() const { return search_terms_; } |
90 | 91 |
91 // Converts a set of TabNavigations into a list of NavigationEntrys | 92 // Converts a set of TabNavigations into a list of NavigationEntrys |
92 // with sequential page IDs and the given context. The caller owns | 93 // with sequential page IDs and the given context. The caller owns |
93 // the returned NavigationEntrys. | 94 // the returned NavigationEntrys. |
94 static std::vector<content::NavigationEntry*> | 95 static std::vector<content::NavigationEntry*> |
95 CreateNavigationEntriesFromTabNavigations( | 96 CreateNavigationEntriesFromTabNavigations( |
96 const std::vector<TabNavigation>& navigations, | 97 const std::vector<TabNavigation>& navigations, |
97 content::BrowserContext* browser_context); | 98 content::BrowserContext* browser_context); |
98 | 99 |
99 private: | 100 private: |
100 friend struct SessionTypesTestHelper; | 101 friend struct SessionTypesTestHelper; |
101 | 102 |
102 // Index in the NavigationController. | 103 // Index in the NavigationController. |
103 int index_; | 104 int index_; |
104 | 105 |
105 // Member variables corresponding to NavigationEntry fields. | 106 // Member variables corresponding to NavigationEntry fields. |
106 int unique_id_; | 107 int unique_id_; |
107 content::Referrer referrer_; | 108 content::Referrer referrer_; |
108 GURL virtual_url_; | 109 GURL virtual_url_; |
109 string16 title_; | 110 string16 title_; |
110 std::string content_state_; | 111 std::string content_state_; |
111 content::PageTransition transition_type_; | 112 content::PageTransition transition_type_; |
112 bool has_post_data_; | 113 bool has_post_data_; |
113 int64 post_id_; | 114 int64 post_id_; |
114 GURL original_request_url_; | 115 GURL original_request_url_; |
115 bool is_overriding_user_agent_; | 116 bool is_overriding_user_agent_; |
116 base::Time timestamp_; | 117 base::Time timestamp_; |
| 118 string16 search_terms_; |
117 }; | 119 }; |
118 | 120 |
119 // SessionTab ---------------------------------------------------------------- | 121 // SessionTab ---------------------------------------------------------------- |
120 | 122 |
121 // SessionTab corresponds to a NavigationController. | 123 // SessionTab corresponds to a NavigationController. |
122 struct SessionTab { | 124 struct SessionTab { |
123 SessionTab(); | 125 SessionTab(); |
124 ~SessionTab(); | 126 ~SessionTab(); |
125 | 127 |
126 // Since the current_navigation_index can be larger than the index for number | 128 // 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... |
236 // Is the window maximized, minimized, or normal? | 238 // Is the window maximized, minimized, or normal? |
237 ui::WindowShowState show_state; | 239 ui::WindowShowState show_state; |
238 | 240 |
239 std::string app_name; | 241 std::string app_name; |
240 | 242 |
241 private: | 243 private: |
242 DISALLOW_COPY_AND_ASSIGN(SessionWindow); | 244 DISALLOW_COPY_AND_ASSIGN(SessionWindow); |
243 }; | 245 }; |
244 | 246 |
245 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ | 247 #endif // CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_ |
OLD | NEW |