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/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "content/common/page_transition_types.h" | |
15 #include "content/common/page_type.h" | 14 #include "content/common/page_type.h" |
16 #include "content/common/security_style.h" | 15 #include "content/common/security_style.h" |
| 16 #include "content/public/common/page_transition_types.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 #include "net/base/cert_status_flags.h" | 18 #include "net/base/cert_status_flags.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 19 #include "third_party/skia/include/core/SkBitmap.h" |
20 | 20 |
21 class SiteInstance; | 21 class SiteInstance; |
22 | 22 |
23 //////////////////////////////////////////////////////////////////////////////// | 23 //////////////////////////////////////////////////////////////////////////////// |
24 // | 24 // |
25 // NavigationEntry class | 25 // NavigationEntry class |
26 // | 26 // |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 }; | 179 }; |
180 | 180 |
181 // --------------------------------------------------------------------------- | 181 // --------------------------------------------------------------------------- |
182 | 182 |
183 NavigationEntry(); | 183 NavigationEntry(); |
184 NavigationEntry(SiteInstance* instance, | 184 NavigationEntry(SiteInstance* instance, |
185 int page_id, | 185 int page_id, |
186 const GURL& url, | 186 const GURL& url, |
187 const GURL& referrer, | 187 const GURL& referrer, |
188 const string16& title, | 188 const string16& title, |
189 PageTransition::Type transition_type); | 189 content::PageTransition transition_type); |
190 ~NavigationEntry(); | 190 ~NavigationEntry(); |
191 | 191 |
192 // Page-related stuff -------------------------------------------------------- | 192 // Page-related stuff -------------------------------------------------------- |
193 | 193 |
194 // A unique ID is preserved across commits and redirects, which means that | 194 // A unique ID is preserved across commits and redirects, which means that |
195 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when | 195 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when |
196 // creating a committed entry to correspond to a to-be-deleted pending entry, | 196 // creating a committed entry to correspond to a to-be-deleted pending entry, |
197 // the pending entry's ID must be copied). | 197 // the pending entry's ID must be copied). |
198 void set_unique_id(int unique_id) { | 198 void set_unique_id(int unique_id) { |
199 unique_id_ = unique_id; | 199 unique_id_ = unique_id; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 const string16& GetTitleForDisplay(const std::string& languages) const; | 337 const string16& GetTitleForDisplay(const std::string& languages) const; |
338 | 338 |
339 // Returns true if the current tab is in view source mode. This will be false | 339 // Returns true if the current tab is in view source mode. This will be false |
340 // if there is no navigation. | 340 // if there is no navigation. |
341 bool IsViewSourceMode() const; | 341 bool IsViewSourceMode() const; |
342 | 342 |
343 // Tracking stuff ------------------------------------------------------------ | 343 // Tracking stuff ------------------------------------------------------------ |
344 | 344 |
345 // The transition type indicates what the user did to move to this page from | 345 // The transition type indicates what the user did to move to this page from |
346 // the previous page. | 346 // the previous page. |
347 void set_transition_type(PageTransition::Type transition_type) { | 347 void set_transition_type(content::PageTransition transition_type) { |
348 transition_type_ = transition_type; | 348 transition_type_ = transition_type; |
349 } | 349 } |
350 PageTransition::Type transition_type() const { | 350 content::PageTransition transition_type() const { |
351 return transition_type_; | 351 return transition_type_; |
352 } | 352 } |
353 | 353 |
354 // The user typed URL was the URL that the user initiated the navigation | 354 // The user typed URL was the URL that the user initiated the navigation |
355 // with, regardless of any redirects. This is used to generate keywords, for | 355 // with, regardless of any redirects. This is used to generate keywords, for |
356 // example, based on "what the user thinks the site is called" rather than | 356 // example, based on "what the user thinks the site is called" rather than |
357 // what it's actually called. For example, if the user types "foo.com", that | 357 // what it's actually called. For example, if the user types "foo.com", that |
358 // may redirect somewhere arbitrary like "bar.com/foo", and we want to use | 358 // may redirect somewhere arbitrary like "bar.com/foo", and we want to use |
359 // the name that the user things of the site as having. | 359 // the name that the user things of the site as having. |
360 // | 360 // |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 PageType page_type_; | 415 PageType page_type_; |
416 GURL url_; | 416 GURL url_; |
417 GURL referrer_; | 417 GURL referrer_; |
418 GURL virtual_url_; | 418 GURL virtual_url_; |
419 bool update_virtual_url_with_url_; | 419 bool update_virtual_url_with_url_; |
420 string16 title_; | 420 string16 title_; |
421 FaviconStatus favicon_; | 421 FaviconStatus favicon_; |
422 std::string content_state_; | 422 std::string content_state_; |
423 int32 page_id_; | 423 int32 page_id_; |
424 SSLStatus ssl_; | 424 SSLStatus ssl_; |
425 PageTransition::Type transition_type_; | 425 content::PageTransition transition_type_; |
426 GURL user_typed_url_; | 426 GURL user_typed_url_; |
427 bool has_post_data_; | 427 bool has_post_data_; |
428 RestoreType restore_type_; | 428 RestoreType restore_type_; |
429 | 429 |
430 // This member is not persisted with sesssion restore. | 430 // This member is not persisted with sesssion restore. |
431 std::string extra_headers_; | 431 std::string extra_headers_; |
432 | 432 |
433 // This is a cached version of the result of GetTitleForDisplay. It prevents | 433 // This is a cached version of the result of GetTitleForDisplay. It prevents |
434 // us from having to do URL formatting on the URL every time the title is | 434 // us from having to do URL formatting on the URL every time the title is |
435 // displayed. When the URL, virtual URL, or title is set, this should be | 435 // displayed. When the URL, virtual URL, or title is set, this should be |
436 // cleared to force a refresh. | 436 // cleared to force a refresh. |
437 mutable string16 cached_display_title_; | 437 mutable string16 cached_display_title_; |
438 | 438 |
439 // Copy and assignment is explicitly allowed for this class. | 439 // Copy and assignment is explicitly allowed for this class. |
440 }; | 440 }; |
441 | 441 |
442 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 442 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
OLD | NEW |