Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/password_manager/password_manager_delegate_impl.h" | 5 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 // TODO(mathp): Checking only against associated_username() causes a bug | 143 // TODO(mathp): Checking only against associated_username() causes a bug |
| 144 // referenced here: crbug.com/133275 | 144 // referenced here: crbug.com/133275 |
| 145 if ((realm == GURL(GaiaUrls::GetInstance()->gaia_login_form_realm()) || | 145 if ((realm == GURL(GaiaUrls::GetInstance()->gaia_login_form_realm()) || |
| 146 realm == GURL("https://www.google.com/")) && | 146 realm == GURL("https://www.google.com/")) && |
| 147 OneClickSigninHelper::CanOffer(tab_contents_->web_contents(), | 147 OneClickSigninHelper::CanOffer(tab_contents_->web_contents(), |
| 148 UTF16ToUTF8(form_to_save->associated_username()), true)) { | 148 UTF16ToUTF8(form_to_save->associated_username()), true)) { |
| 149 return; | 149 return; |
| 150 } | 150 } |
| 151 #endif | 151 #endif |
| 152 | 152 |
| 153 // Don't show the password manager infobar if this form corresponds to | |
| 154 // SpdyProxy authentication, as indicated by the realm. | |
|
Ilya Sherman
2012/09/24 23:47:25
What is the user action that would reach this code
Michael Piatek
2012/09/25 19:28:14
This is designed to suppress the 'remember the pas
Ilya Sherman
2012/09/25 22:31:07
Can you describe more what "this authentication ty
Michael Piatek
2012/09/26 23:08:34
moved this to password_manager.cc per discussion
| |
| 155 if (form_to_save->realm().find("/SpdyProxy") != std::string::npos) { | |
|
Ilya Sherman
2012/09/24 23:47:25
nit: Please define a constant for this string. Al
Michael Piatek
2012/09/25 19:28:14
Done. (Checked for a suffix match, since the full
| |
| 156 return; | |
| 157 } | |
|
Ilya Sherman
2012/09/24 23:47:25
nit: No need for curly braces.
Michael Piatek
2012/09/25 19:28:14
Done.
| |
| 158 | |
| 153 tab_contents_->infobar_tab_helper()->AddInfoBar( | 159 tab_contents_->infobar_tab_helper()->AddInfoBar( |
| 154 new SavePasswordInfoBarDelegate( | 160 new SavePasswordInfoBarDelegate( |
| 155 tab_contents_->infobar_tab_helper(), form_to_save)); | 161 tab_contents_->infobar_tab_helper(), form_to_save)); |
| 156 } | 162 } |
| 157 | 163 |
| 158 Profile* PasswordManagerDelegateImpl::GetProfile() { | 164 Profile* PasswordManagerDelegateImpl::GetProfile() { |
| 159 return tab_contents_->profile(); | 165 return tab_contents_->profile(); |
| 160 } | 166 } |
| 161 | 167 |
| 162 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { | 168 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { |
| 163 content::NavigationEntry* entry = | 169 content::NavigationEntry* entry = |
| 164 tab_contents_->web_contents()->GetController().GetActiveEntry(); | 170 tab_contents_->web_contents()->GetController().GetActiveEntry(); |
| 165 if (!entry) { | 171 if (!entry) { |
| 166 NOTREACHED(); | 172 NOTREACHED(); |
| 167 return false; | 173 return false; |
| 168 } | 174 } |
| 169 | 175 |
| 170 return net::IsCertStatusError(entry->GetSSL().cert_status); | 176 return net::IsCertStatusError(entry->GetSSL().cert_status); |
| 171 } | 177 } |
| OLD | NEW |