Index: chrome/browser/ui/toolbar/toolbar_model.cc |
diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc |
index b8091a3aa1d6d3531805af9ab4ff043f51b72380..472a8eb9a58b6f8108dbc3f7f75832d0d1059780 100644 |
--- a/chrome/browser/ui/toolbar/toolbar_model.cc |
+++ b/chrome/browser/ui/toolbar/toolbar_model.cc |
@@ -122,6 +122,29 @@ std::wstring ToolbarModel::GetEVCertName() const { |
return UTF16ToWideHack(SSLManager::GetEVCertName(*cert)); |
} |
+string16 ToolbarModel::GetSiteName() const { |
+ DCHECK(GetNavigationController()); |
+ DCHECK(GetNavigationController()->GetActiveEntry()); |
+ return UTF8ToUTF16(net::GetHostAndPort( |
+ GetNavigationController()->GetActiveEntry()->url())); |
+} |
+ |
+string16 ToolbarModel::GetSiteAccount() const { |
+ if (!GetNavigationController() || |
+ !GetNavigationController()->GetActiveEntry()) |
+ return string16(); |
+ |
+ // TODO(sqs): find a better way of indicating "Logging in..." than just |
+ // returning a string here |
+ NavigationEntry* entry = GetNavigationController()->GetActiveEntry(); |
+ if (!entry->ssl().tls_username().empty()) |
+ return entry->ssl().tls_username(); |
+ else if (0) // TODO(sqs): find if logging in |
+ return ASCIIToUTF16("Logging in..."); |
+ else |
+ return string16(); |
+} |
+ |
NavigationController* ToolbarModel::GetNavigationController() const { |
// This |current_tab| can be NULL during the initialization of the |
// toolbar during window creation (i.e. before any tabs have been added |