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

Side by Side Diff: chrome/browser/password_manager_delegate_impl.cc

Issue 9600038: Add Password Autofill Manager to New Autofill (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing final nits Created 8 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
« no previous file with comments | « chrome/browser/autofill/test_autofill_external_delegate.cc ('k') | chrome/chrome_browser.gypi » ('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) 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_delegate_impl.h" 5 #include "chrome/browser/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 "chrome/browser/autofill/autofill_manager.h"
9 #include "chrome/browser/infobars/infobar_tab_helper.h" 10 #include "chrome/browser/infobars/infobar_tab_helper.h"
10 #include "chrome/browser/password_manager/password_form_manager.h" 11 #include "chrome/browser/password_manager/password_form_manager.h"
11 #include "chrome/browser/password_manager/password_manager.h" 12 #include "chrome/browser/password_manager/password_manager.h"
12 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 13 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
13 #include "chrome/browser/ui/sync/one_click_signin_helper.h" 14 #include "chrome/browser/ui/sync/one_click_signin_helper.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
15 #include "chrome/common/autofill_messages.h" 16 #include "chrome/common/autofill_messages.h"
16 #include "chrome/common/net/gaia/gaia_urls.h" 17 #include "chrome/common/net/gaia/gaia_urls.h"
17 #include "content/public/browser/navigation_entry.h" 18 #include "content/public/browser/navigation_entry.h"
18 #include "content/public/browser/render_view_host.h" 19 #include "content/public/browser/render_view_host.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 117
117 SavePasswordInfoBarDelegate* 118 SavePasswordInfoBarDelegate*
118 SavePasswordInfoBarDelegate::AsSavePasswordInfoBarDelegate() { 119 SavePasswordInfoBarDelegate::AsSavePasswordInfoBarDelegate() {
119 return this; 120 return this;
120 } 121 }
121 122
122 // PasswordManagerDelegateImpl ------------------------------------------------ 123 // PasswordManagerDelegateImpl ------------------------------------------------
123 124
124 void PasswordManagerDelegateImpl::FillPasswordForm( 125 void PasswordManagerDelegateImpl::FillPasswordForm(
125 const webkit::forms::PasswordFormFillData& form_data) { 126 const webkit::forms::PasswordFormFillData& form_data) {
127 bool disable_popup = tab_contents_->autofill_manager()->HasExternalDelegate();
128
126 tab_contents_->web_contents()->GetRenderViewHost()->Send( 129 tab_contents_->web_contents()->GetRenderViewHost()->Send(
127 new AutofillMsg_FillPasswordForm( 130 new AutofillMsg_FillPasswordForm(
128 tab_contents_->web_contents()->GetRenderViewHost()->GetRoutingID(), 131 tab_contents_->web_contents()->GetRenderViewHost()->GetRoutingID(),
129 form_data)); 132 form_data,
133 disable_popup));
130 } 134 }
131 135
132 void PasswordManagerDelegateImpl::AddSavePasswordInfoBarIfPermitted( 136 void PasswordManagerDelegateImpl::AddSavePasswordInfoBarIfPermitted(
133 PasswordFormManager* form_to_save) { 137 PasswordFormManager* form_to_save) {
134 // Don't show the password manager infobar if this form is for a google 138 // Don't show the password manager infobar if this form is for a google
135 // account and we are going to show the one-click singin infobar. 139 // account and we are going to show the one-click singin infobar.
136 // For now, one-click signin is fully implemented only on windows. 140 // For now, one-click signin is fully implemented only on windows.
137 #if defined(ENABLE_ONE_CLICK_SIGNIN) 141 #if defined(ENABLE_ONE_CLICK_SIGNIN)
138 GURL realm(form_to_save->realm()); 142 GURL realm(form_to_save->realm());
139 if (realm == GURL(GaiaUrls::GetInstance()->gaia_login_form_realm()) && 143 if (realm == GURL(GaiaUrls::GetInstance()->gaia_login_form_realm()) &&
(...skipping 14 matching lines...) Expand all
154 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { 158 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() {
155 content::NavigationEntry* entry = 159 content::NavigationEntry* entry =
156 tab_contents_->web_contents()->GetController().GetActiveEntry(); 160 tab_contents_->web_contents()->GetController().GetActiveEntry();
157 if (!entry) { 161 if (!entry) {
158 NOTREACHED(); 162 NOTREACHED();
159 return false; 163 return false;
160 } 164 }
161 165
162 return net::IsCertStatusError(entry->GetSSL().cert_status); 166 return net::IsCertStatusError(entry->GetSSL().cert_status);
163 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/test_autofill_external_delegate.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698