Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model.cc

Issue 6804032: Add TLS-SRP (RFC 5054) support Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: remove "httpsv" scheme, minor NSS/OpenSSL changes Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model.h ('k') | net/base/auth.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/ui/toolbar/toolbar_model.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autocomplete/autocomplete.h" 8 #include "chrome/browser/autocomplete/autocomplete.h"
9 #include "chrome/browser/autocomplete/autocomplete_edit.h" 9 #include "chrome/browser/autocomplete/autocomplete_edit.h"
10 #include "chrome/browser/cert_store.h" 10 #include "chrome/browser/cert_store.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 std::wstring ToolbarModel::GetEVCertName() const { 115 std::wstring ToolbarModel::GetEVCertName() const {
116 DCHECK_EQ(GetSecurityLevel(), EV_SECURE); 116 DCHECK_EQ(GetSecurityLevel(), EV_SECURE);
117 scoped_refptr<net::X509Certificate> cert; 117 scoped_refptr<net::X509Certificate> cert;
118 // Note: Navigation controller and active entry are guaranteed non-NULL or 118 // Note: Navigation controller and active entry are guaranteed non-NULL or
119 // the security level would be NONE. 119 // the security level would be NONE.
120 CertStore::GetInstance()->RetrieveCert( 120 CertStore::GetInstance()->RetrieveCert(
121 GetNavigationController()->GetActiveEntry()->ssl().cert_id(), &cert); 121 GetNavigationController()->GetActiveEntry()->ssl().cert_id(), &cert);
122 return UTF16ToWideHack(SSLManager::GetEVCertName(*cert)); 122 return UTF16ToWideHack(SSLManager::GetEVCertName(*cert));
123 } 123 }
124 124
125 string16 ToolbarModel::GetSiteName() const {
126 DCHECK(GetNavigationController());
127 DCHECK(GetNavigationController()->GetActiveEntry());
128 return UTF8ToUTF16(net::GetHostAndPort(
129 GetNavigationController()->GetActiveEntry()->url()));
130 }
131
132 string16 ToolbarModel::GetSiteAccount() const {
133 if (!GetNavigationController() ||
134 !GetNavigationController()->GetActiveEntry())
135 return string16();
136
137 // TODO(sqs): find a better way of indicating "Logging in..." than just
138 // returning a string here
139 NavigationEntry* entry = GetNavigationController()->GetActiveEntry();
140 if (!entry->ssl().tls_username().empty())
141 return entry->ssl().tls_username();
142 else if (0) // TODO(sqs): find if logging in
143 return ASCIIToUTF16("Logging in...");
144 else
145 return string16();
146 }
147
125 NavigationController* ToolbarModel::GetNavigationController() const { 148 NavigationController* ToolbarModel::GetNavigationController() const {
126 // This |current_tab| can be NULL during the initialization of the 149 // This |current_tab| can be NULL during the initialization of the
127 // toolbar during window creation (i.e. before any tabs have been added 150 // toolbar during window creation (i.e. before any tabs have been added
128 // to the window). 151 // to the window).
129 TabContents* current_tab = browser_->GetSelectedTabContents(); 152 TabContents* current_tab = browser_->GetSelectedTabContents();
130 return current_tab ? &current_tab->controller() : NULL; 153 return current_tab ? &current_tab->controller() : NULL;
131 } 154 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model.h ('k') | net/base/auth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698