| 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" |
| 11 #include "content/common/content_constants.h" | 11 #include "content/common/content_constants.h" |
| 12 #include "content/common/url_constants.h" | 12 #include "content/common/url_constants.h" |
| 13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
| 14 #include "ui/base/text/text_elider.h" | 14 #include "ui/base/text/text_elider.h" |
| 15 | 15 |
| 16 // Use this to get a new unique ID for a NavigationEntry during construction. | 16 // Use this to get a new unique ID for a NavigationEntry during construction. |
| 17 // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator). | 17 // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator). |
| 18 static int GetUniqueID() { | 18 static int GetUniqueID() { |
| 19 static int unique_id_counter = 0; | 19 static int unique_id_counter = 0; |
| 20 return ++unique_id_counter; | 20 return ++unique_id_counter; |
| 21 } | 21 } |
| 22 | 22 |
| 23 NavigationEntry::SSLStatus::SSLStatus() | 23 NavigationEntry::SSLStatus::SSLStatus() |
| 24 : security_style_(SECURITY_STYLE_UNKNOWN), | 24 : security_style_(SECURITY_STYLE_UNKNOWN), |
| 25 cert_id_(0), | 25 cert_id_(0), |
| 26 cert_status_(0), | 26 cert_status_(net::CERT_STATUS_NO_ERROR), |
| 27 security_bits_(-1), | 27 security_bits_(-1), |
| 28 connection_status_(0), | 28 connection_status_(0), |
| 29 content_status_(NORMAL_CONTENT) { | 29 content_status_(NORMAL_CONTENT) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 NavigationEntry::FaviconStatus::FaviconStatus() : valid_(false) { | 32 NavigationEntry::FaviconStatus::FaviconStatus() : valid_(false) { |
| 33 bitmap_ = *content::GetContentClient()->browser()->GetDefaultFavicon(); | 33 bitmap_ = *content::GetContentClient()->browser()->GetDefaultFavicon(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 | 36 |
| (...skipping 61 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 |