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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 disable_popup)); | 146 disable_popup)); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void PasswordManagerDelegateImpl::AddSavePasswordInfoBarIfPermitted( | 149 void PasswordManagerDelegateImpl::AddSavePasswordInfoBarIfPermitted( |
| 150 PasswordFormManager* form_to_save) { | 150 PasswordFormManager* form_to_save) { |
| 151 // Don't show the password manager infobar if this form is for a google | 151 // Don't show the password manager infobar if this form is for a google |
| 152 // account and we are going to show the one-click singin infobar. | 152 // account and we are going to show the one-click singin infobar. |
| 153 // For now, one-click signin is fully implemented only on windows. | 153 // For now, one-click signin is fully implemented only on windows. |
| 154 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 154 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 155 GURL realm(form_to_save->realm()); | 155 GURL realm(form_to_save->realm()); |
| 156 int error_message_id = 0; | |
|
Andrew T Wilson (Slow)
2012/12/03 14:54:49
I guess we're trying to ignore the error message s
Roger Tawa OOO till Jul 10th
2012/12/03 22:26:54
Done.
| |
| 156 // TODO(mathp): Checking only against associated_username() causes a bug | 157 // TODO(mathp): Checking only against associated_username() causes a bug |
| 157 // referenced here: crbug.com/133275 | 158 // referenced here: crbug.com/133275 |
| 158 if ((realm == GURL(GaiaUrls::GetInstance()->gaia_login_form_realm()) || | 159 if ((realm == GURL(GaiaUrls::GetInstance()->gaia_login_form_realm()) || |
| 159 realm == GURL("https://www.google.com/")) && | 160 realm == GURL("https://www.google.com/")) && |
| 160 OneClickSigninHelper::CanOffer(web_contents_, | 161 OneClickSigninHelper::CanOffer(web_contents_, |
| 161 UTF16ToUTF8(form_to_save->associated_username()), true)) { | 162 OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, |
| 163 UTF16ToUTF8(form_to_save->associated_username()), | |
| 164 &error_message_id)) { | |
| 162 return; | 165 return; |
| 163 } | 166 } |
| 164 #endif | 167 #endif |
| 165 | 168 |
| 166 InfoBarTabHelper* infobar_tab_helper = | 169 InfoBarTabHelper* infobar_tab_helper = |
| 167 InfoBarTabHelper::FromWebContents(web_contents_); | 170 InfoBarTabHelper::FromWebContents(web_contents_); |
| 168 infobar_tab_helper->AddInfoBar( | 171 infobar_tab_helper->AddInfoBar( |
| 169 new SavePasswordInfoBarDelegate(infobar_tab_helper, form_to_save)); | 172 new SavePasswordInfoBarDelegate(infobar_tab_helper, form_to_save)); |
| 170 } | 173 } |
| 171 | 174 |
| 172 Profile* PasswordManagerDelegateImpl::GetProfile() { | 175 Profile* PasswordManagerDelegateImpl::GetProfile() { |
| 173 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 176 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 174 } | 177 } |
| 175 | 178 |
| 176 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { | 179 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { |
| 177 content::NavigationEntry* entry = | 180 content::NavigationEntry* entry = |
| 178 web_contents_->GetController().GetActiveEntry(); | 181 web_contents_->GetController().GetActiveEntry(); |
| 179 if (!entry) { | 182 if (!entry) { |
| 180 NOTREACHED(); | 183 NOTREACHED(); |
| 181 return false; | 184 return false; |
| 182 } | 185 } |
| 183 | 186 |
| 184 return net::IsCertStatusError(entry->GetSSL().cert_status); | 187 return net::IsCertStatusError(entry->GetSSL().cert_status); |
| 185 } | 188 } |
| OLD | NEW |