| 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..fd8189e27e89275590c535661570632e1c2ce50a 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 (entry->url().SchemeIs("httpsv"))
|
| + 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
|
|
|