| 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/navigation_entry.h" | 5 #include "chrome/browser/navigation_entry.h" |
| 6 | 6 |
| 7 #include "chrome/common/resource_bundle.h" | 7 #include "chrome/common/resource_bundle.h" |
| 8 | 8 |
| 9 // Use this to get a new unique ID for a NavigationEntry during construction. | 9 // Use this to get a new unique ID for a NavigationEntry during construction. |
| 10 // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator). | 10 // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator). |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 page_id_(-1), | 34 page_id_(-1), |
| 35 transition_type_(PageTransition::LINK), | 35 transition_type_(PageTransition::LINK), |
| 36 has_post_data_(false), | 36 has_post_data_(false), |
| 37 restored_(false) { | 37 restored_(false) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 NavigationEntry::NavigationEntry(TabContentsType type, | 40 NavigationEntry::NavigationEntry(TabContentsType type, |
| 41 SiteInstance* instance, | 41 SiteInstance* instance, |
| 42 int page_id, | 42 int page_id, |
| 43 const GURL& url, | 43 const GURL& url, |
| 44 const GURL& referrer, |
| 44 const std::wstring& title, | 45 const std::wstring& title, |
| 45 PageTransition::Type transition_type) | 46 PageTransition::Type transition_type) |
| 46 : unique_id_(GetUniqueID()), | 47 : unique_id_(GetUniqueID()), |
| 47 tab_type_(type), | 48 tab_type_(type), |
| 48 site_instance_(instance), | 49 site_instance_(instance), |
| 49 page_type_(NORMAL_PAGE), | 50 page_type_(NORMAL_PAGE), |
| 50 url_(url), | 51 url_(url), |
| 52 referrer_(referrer), |
| 51 title_(title), | 53 title_(title), |
| 52 page_id_(page_id), | 54 page_id_(page_id), |
| 53 transition_type_(transition_type), | 55 transition_type_(transition_type), |
| 54 has_post_data_(false), | 56 has_post_data_(false), |
| 55 restored_(false) { | 57 restored_(false) { |
| 56 } | 58 } |
| 57 | 59 |
| 58 const std::wstring& NavigationEntry::GetTitleForDisplay() { | 60 const std::wstring& NavigationEntry::GetTitleForDisplay() { |
| 59 if (title_.empty()) | 61 if (title_.empty()) |
| 60 return url_as_string_; | 62 return url_as_string_; |
| 61 return title_; | 63 return title_; |
| 62 } | 64 } |
| OLD | NEW |