| 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 #include "net/base/escape.h" |
| 8 | 9 |
| 9 // Use this to get a new unique ID for a NavigationEntry during construction. | 10 // 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). | 11 // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator). |
| 11 static int GetUniqueID() { | 12 static int GetUniqueID() { |
| 12 static int unique_id_counter = 0; | 13 static int unique_id_counter = 0; |
| 13 return ++unique_id_counter; | 14 return ++unique_id_counter; |
| 14 } | 15 } |
| 15 | 16 |
| 16 NavigationEntry::SSLStatus::SSLStatus() | 17 NavigationEntry::SSLStatus::SSLStatus() |
| 17 : security_style_(SECURITY_STYLE_UNKNOWN), | 18 : security_style_(SECURITY_STYLE_UNKNOWN), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 url_(url), | 52 url_(url), |
| 52 referrer_(referrer), | 53 referrer_(referrer), |
| 53 title_(title), | 54 title_(title), |
| 54 page_id_(page_id), | 55 page_id_(page_id), |
| 55 transition_type_(transition_type), | 56 transition_type_(transition_type), |
| 56 has_post_data_(false), | 57 has_post_data_(false), |
| 57 restored_(false) { | 58 restored_(false) { |
| 58 } | 59 } |
| 59 | 60 |
| 60 const std::wstring& NavigationEntry::GetTitleForDisplay() { | 61 const std::wstring& NavigationEntry::GetTitleForDisplay() { |
| 61 if (title_.empty()) | 62 if (title_.empty()) { |
| 62 return url_as_string_; | 63 title_ = UTF8ToWide(url_.ExtractFileName().empty() ? |
| 64 url_.spec() : |
| 65 UnescapeURLComponent(url_.ExtractFileName(), |
| 66 UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS)); |
| 67 } |
| 63 return title_; | 68 return title_; |
| 64 } | 69 } |
| OLD | NEW |