OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/tab_contents/navigation_entry.h" | 5 #include "chrome/browser/tab_contents/navigation_entry.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/browser/renderer_host/site_instance.h" | 10 #include "chrome/browser/renderer_host/site_instance.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 NavigationEntry::NavigationEntry() | 39 NavigationEntry::NavigationEntry() |
40 : unique_id_(GetUniqueID()), | 40 : unique_id_(GetUniqueID()), |
41 site_instance_(NULL), | 41 site_instance_(NULL), |
42 page_type_(NORMAL_PAGE), | 42 page_type_(NORMAL_PAGE), |
43 page_id_(-1), | 43 page_id_(-1), |
44 transition_type_(PageTransition::LINK), | 44 transition_type_(PageTransition::LINK), |
45 has_post_data_(false), | 45 has_post_data_(false), |
46 restored_(false) { | 46 restore_type_(RESTORE_NONE) { |
47 } | 47 } |
48 | 48 |
49 NavigationEntry::NavigationEntry(SiteInstance* instance, | 49 NavigationEntry::NavigationEntry(SiteInstance* instance, |
50 int page_id, | 50 int page_id, |
51 const GURL& url, | 51 const GURL& url, |
52 const GURL& referrer, | 52 const GURL& referrer, |
53 const string16& title, | 53 const string16& title, |
54 PageTransition::Type transition_type) | 54 PageTransition::Type transition_type) |
55 : unique_id_(GetUniqueID()), | 55 : unique_id_(GetUniqueID()), |
56 site_instance_(instance), | 56 site_instance_(instance), |
57 page_type_(NORMAL_PAGE), | 57 page_type_(NORMAL_PAGE), |
58 url_(url), | 58 url_(url), |
59 referrer_(referrer), | 59 referrer_(referrer), |
60 title_(title), | 60 title_(title), |
61 page_id_(page_id), | 61 page_id_(page_id), |
62 transition_type_(transition_type), | 62 transition_type_(transition_type), |
63 has_post_data_(false), | 63 has_post_data_(false), |
64 restored_(false) { | 64 restore_type_(RESTORE_NONE) { |
65 } | 65 } |
66 | 66 |
67 NavigationEntry::~NavigationEntry() { | 67 NavigationEntry::~NavigationEntry() { |
68 } | 68 } |
69 | 69 |
70 void NavigationEntry::set_site_instance(SiteInstance* site_instance) { | 70 void NavigationEntry::set_site_instance(SiteInstance* site_instance) { |
71 site_instance_ = site_instance; | 71 site_instance_ = site_instance; |
72 } | 72 } |
73 | 73 |
74 const string16& NavigationEntry::GetTitleForDisplay( | 74 const string16& NavigationEntry::GetTitleForDisplay( |
(...skipping 19 matching lines...) Expand all Loading... |
94 virtual_url_, languages)); | 94 virtual_url_, languages)); |
95 } else if (!url_.is_empty()) { | 95 } else if (!url_.is_empty()) { |
96 cached_display_title_ = WideToUTF16Hack(net::FormatUrl(url_, languages)); | 96 cached_display_title_ = WideToUTF16Hack(net::FormatUrl(url_, languages)); |
97 } | 97 } |
98 return cached_display_title_; | 98 return cached_display_title_; |
99 } | 99 } |
100 | 100 |
101 bool NavigationEntry::IsViewSourceMode() const { | 101 bool NavigationEntry::IsViewSourceMode() const { |
102 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); | 102 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); |
103 } | 103 } |
OLD | NEW |