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 #include "content/browser/tab_contents/navigation_entry.h" | 5 #include "content/browser/tab_contents/navigation_entry.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/browser/content_browser_client.h" | 9 #include "content/browser/content_browser_client.h" |
10 #include "content/browser/site_instance.h" | 10 #include "content/browser/site_instance.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 bitmap_ = *content::GetContentClient()->browser()->GetDefaultFavicon(); | 33 bitmap_ = *content::GetContentClient()->browser()->GetDefaultFavicon(); |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 NavigationEntry::NavigationEntry() | 37 NavigationEntry::NavigationEntry() |
38 : unique_id_(GetUniqueID()), | 38 : unique_id_(GetUniqueID()), |
39 site_instance_(NULL), | 39 site_instance_(NULL), |
40 page_type_(NORMAL_PAGE), | 40 page_type_(NORMAL_PAGE), |
41 update_virtual_url_with_url_(false), | 41 update_virtual_url_with_url_(false), |
42 page_id_(-1), | 42 page_id_(-1), |
43 transition_type_(PageTransition::LINK), | 43 transition_type_(content::PAGE_TRANSITION_LINK), |
44 has_post_data_(false), | 44 has_post_data_(false), |
45 restore_type_(RESTORE_NONE) { | 45 restore_type_(RESTORE_NONE) { |
46 } | 46 } |
47 | 47 |
48 NavigationEntry::NavigationEntry(SiteInstance* instance, | 48 NavigationEntry::NavigationEntry(SiteInstance* instance, |
49 int page_id, | 49 int page_id, |
50 const GURL& url, | 50 const GURL& url, |
51 const GURL& referrer, | 51 const GURL& referrer, |
52 const string16& title, | 52 const string16& title, |
53 PageTransition::Type transition_type) | 53 content::PageTransition transition_type) |
54 : unique_id_(GetUniqueID()), | 54 : unique_id_(GetUniqueID()), |
55 site_instance_(instance), | 55 site_instance_(instance), |
56 page_type_(NORMAL_PAGE), | 56 page_type_(NORMAL_PAGE), |
57 url_(url), | 57 url_(url), |
58 referrer_(referrer), | 58 referrer_(referrer), |
59 update_virtual_url_with_url_(false), | 59 update_virtual_url_with_url_(false), |
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), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 title = title.substr(slashpos + 1); | 98 title = title.substr(slashpos + 1); |
99 } | 99 } |
100 | 100 |
101 ui::ElideString(title, content::kMaxTitleChars, &cached_display_title_); | 101 ui::ElideString(title, content::kMaxTitleChars, &cached_display_title_); |
102 return cached_display_title_; | 102 return cached_display_title_; |
103 } | 103 } |
104 | 104 |
105 bool NavigationEntry::IsViewSourceMode() const { | 105 bool NavigationEntry::IsViewSourceMode() const { |
106 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); | 106 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); |
107 } | 107 } |
OLD | NEW |