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 87 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 } |
| 108 |
| 109 bool NavigationEntry::IsBrowserInitiated() const { |
| 110 // Most PageTransition types are browser initiated. LINK and FORM_SUBMIT |
| 111 // indicate it was a renderer-initiated navigation. |
| 112 return transition_type_ != PageTransition::LINK && |
| 113 transition_type_ != PageTransition::FORM_SUBMIT; |
| 114 } |
| 115 |
OLD | NEW |