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 "app/text_elider.h" |
8 #include "base/string_util.h" | 9 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/renderer_host/site_instance.h" | 13 #include "chrome/browser/renderer_host/site_instance.h" |
13 #include "chrome/browser/tab_contents/navigation_controller.h" | 14 #include "chrome/browser/tab_contents/navigation_controller.h" |
14 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
16 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
17 #include "grit/app_resources.h" | 18 #include "grit/app_resources.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 GetString(prefs::kAcceptLanguages); | 96 GetString(prefs::kAcceptLanguages); |
96 } | 97 } |
97 | 98 |
98 string16 title; | 99 string16 title; |
99 std::wstring elided_title; | 100 std::wstring elided_title; |
100 if (!virtual_url_.is_empty()) { | 101 if (!virtual_url_.is_empty()) { |
101 title = net::FormatUrl(virtual_url_, languages); | 102 title = net::FormatUrl(virtual_url_, languages); |
102 } else if (!url_.is_empty()) { | 103 } else if (!url_.is_empty()) { |
103 title = net::FormatUrl(url_, languages); | 104 title = net::FormatUrl(url_, languages); |
104 } | 105 } |
105 ElideString(UTF16ToWideHack(title), chrome::kMaxTitleChars, &elided_title); | 106 gfx::ElideString(UTF16ToWideHack(title), |
| 107 chrome::kMaxTitleChars, |
| 108 &elided_title); |
106 cached_display_title_ = WideToUTF16Hack(elided_title); | 109 cached_display_title_ = WideToUTF16Hack(elided_title); |
107 return cached_display_title_; | 110 return cached_display_title_; |
108 } | 111 } |
109 | 112 |
110 bool NavigationEntry::IsViewSourceMode() const { | 113 bool NavigationEntry::IsViewSourceMode() const { |
111 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); | 114 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); |
112 } | 115 } |
OLD | NEW |