OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "content/browser/renderer_host/global_request_id.h" | 13 #include "content/browser/renderer_host/global_request_id.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/common/page_transition_types.h" | 15 #include "content/public/common/page_transition_types.h" |
16 #include "content/public/common/page_type.h" | 16 #include "content/public/common/page_type.h" |
| 17 #include "content/public/common/referrer.h" |
17 #include "content/public/common/security_style.h" | 18 #include "content/public/common/security_style.h" |
18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
19 #include "net/base/cert_status_flags.h" | 20 #include "net/base/cert_status_flags.h" |
20 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
21 | 22 |
22 class SiteInstance; | 23 class SiteInstance; |
23 | 24 |
24 //////////////////////////////////////////////////////////////////////////////// | 25 //////////////////////////////////////////////////////////////////////////////// |
25 // | 26 // |
26 // NavigationEntry class | 27 // NavigationEntry class |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 179 |
179 // Copy and assignment is explicitly allowed for this class. | 180 // Copy and assignment is explicitly allowed for this class. |
180 }; | 181 }; |
181 | 182 |
182 // --------------------------------------------------------------------------- | 183 // --------------------------------------------------------------------------- |
183 | 184 |
184 NavigationEntry(); | 185 NavigationEntry(); |
185 NavigationEntry(SiteInstance* instance, | 186 NavigationEntry(SiteInstance* instance, |
186 int page_id, | 187 int page_id, |
187 const GURL& url, | 188 const GURL& url, |
188 const GURL& referrer, | 189 const content::Referrer& referrer, |
189 const string16& title, | 190 const string16& title, |
190 content::PageTransition transition_type, | 191 content::PageTransition transition_type, |
191 bool is_renderer_initiated); | 192 bool is_renderer_initiated); |
192 ~NavigationEntry(); | 193 ~NavigationEntry(); |
193 | 194 |
194 // Page-related stuff -------------------------------------------------------- | 195 // Page-related stuff -------------------------------------------------------- |
195 | 196 |
196 // A unique ID is preserved across commits and redirects, which means that | 197 // A unique ID is preserved across commits and redirects, which means that |
197 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when | 198 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when |
198 // creating a committed entry to correspond to a to-be-deleted pending entry, | 199 // creating a committed entry to correspond to a to-be-deleted pending entry, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // the user. | 231 // the user. |
231 void set_url(const GURL& url) { | 232 void set_url(const GURL& url) { |
232 url_ = url; | 233 url_ = url; |
233 cached_display_title_.clear(); | 234 cached_display_title_.clear(); |
234 } | 235 } |
235 const GURL& url() const { | 236 const GURL& url() const { |
236 return url_; | 237 return url_; |
237 } | 238 } |
238 | 239 |
239 // The referring URL. Can be empty. | 240 // The referring URL. Can be empty. |
240 void set_referrer(const GURL& referrer) { | 241 void set_referrer(const content::Referrer& referrer) { |
241 referrer_ = referrer; | 242 referrer_ = referrer; |
242 } | 243 } |
243 const GURL& referrer() const { | 244 const content::Referrer& referrer() const { |
244 return referrer_; | 245 return referrer_; |
245 } | 246 } |
246 | 247 |
247 // The virtual URL, when nonempty, will override the actual URL of the page | 248 // The virtual URL, when nonempty, will override the actual URL of the page |
248 // when we display it to the user. This allows us to have nice and friendly | 249 // when we display it to the user. This allows us to have nice and friendly |
249 // URLs that the user sees for things like about: URLs, but actually feed | 250 // URLs that the user sees for things like about: URLs, but actually feed |
250 // the renderer a data URL that results in the content loading. | 251 // the renderer a data URL that results in the content loading. |
251 // | 252 // |
252 // virtual_url() will return the URL to display to the user in all cases, so | 253 // virtual_url() will return the URL to display to the user in all cases, so |
253 // if there is no overridden display URL, it will return the actual one. | 254 // if there is no overridden display URL, it will return the actual one. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // Session/Tab restore save portions of this class so that it can be recreated | 428 // Session/Tab restore save portions of this class so that it can be recreated |
428 // later. If you add a new field that needs to be persisted you'll have to | 429 // later. If you add a new field that needs to be persisted you'll have to |
429 // update SessionService/TabRestoreService appropriately. | 430 // update SessionService/TabRestoreService appropriately. |
430 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 431 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
431 | 432 |
432 // See the accessors above for descriptions. | 433 // See the accessors above for descriptions. |
433 int unique_id_; | 434 int unique_id_; |
434 scoped_refptr<SiteInstance> site_instance_; | 435 scoped_refptr<SiteInstance> site_instance_; |
435 content::PageType page_type_; | 436 content::PageType page_type_; |
436 GURL url_; | 437 GURL url_; |
437 GURL referrer_; | 438 content::Referrer referrer_; |
438 GURL virtual_url_; | 439 GURL virtual_url_; |
439 bool update_virtual_url_with_url_; | 440 bool update_virtual_url_with_url_; |
440 string16 title_; | 441 string16 title_; |
441 FaviconStatus favicon_; | 442 FaviconStatus favicon_; |
442 std::string content_state_; | 443 std::string content_state_; |
443 int32 page_id_; | 444 int32 page_id_; |
444 SSLStatus ssl_; | 445 SSLStatus ssl_; |
445 content::PageTransition transition_type_; | 446 content::PageTransition transition_type_; |
446 GURL user_typed_url_; | 447 GURL user_typed_url_; |
447 bool has_post_data_; | 448 bool has_post_data_; |
(...skipping 19 matching lines...) Expand all Loading... |
467 // ResourceDispatcher receives the navigation from the renderer which | 468 // ResourceDispatcher receives the navigation from the renderer which |
468 // carries this |transferred_global_request_id_| annotation. Once the request | 469 // carries this |transferred_global_request_id_| annotation. Once the request |
469 // is transferred to the new process, this is cleared and the request | 470 // is transferred to the new process, this is cleared and the request |
470 // continues as normal. | 471 // continues as normal. |
471 GlobalRequestID transferred_global_request_id_; | 472 GlobalRequestID transferred_global_request_id_; |
472 | 473 |
473 // Copy and assignment is explicitly allowed for this class. | 474 // Copy and assignment is explicitly allowed for this class. |
474 }; | 475 }; |
475 | 476 |
476 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 477 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
OLD | NEW |