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

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

Issue 12340065: Move the UI related code from AutofillExternalDelegate to AutofillManagerDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Try to fix AutofillTest.DisableAutocompleteWhileFilling Created 7 years, 10 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
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/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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 : web_contents_(web_contents) { 159 : web_contents_(web_contents) {
160 } 160 }
161 161
162 PasswordManagerDelegateImpl::~PasswordManagerDelegateImpl() { 162 PasswordManagerDelegateImpl::~PasswordManagerDelegateImpl() {
163 } 163 }
164 164
165 void PasswordManagerDelegateImpl::FillPasswordForm( 165 void PasswordManagerDelegateImpl::FillPasswordForm(
166 const PasswordFormFillData& form_data) { 166 const PasswordFormFillData& form_data) {
167 AutofillManager* autofill_manager = 167 AutofillManager* autofill_manager =
168 AutofillManager::FromWebContents(web_contents_); 168 AutofillManager::FromWebContents(web_contents_);
169 bool disable_popup = autofill_manager->HasExternalDelegate(); 169 // Browser process will own popup UI, so renderer should not show the popup.
170 bool disable_popup = autofill_manager->IsNativeUiEnabled();
170 171
171 web_contents_->GetRenderViewHost()->Send( 172 web_contents_->GetRenderViewHost()->Send(
172 new AutofillMsg_FillPasswordForm( 173 new AutofillMsg_FillPasswordForm(
173 web_contents_->GetRenderViewHost()->GetRoutingID(), 174 web_contents_->GetRenderViewHost()->GetRoutingID(),
174 form_data, 175 form_data,
175 disable_popup)); 176 disable_popup));
176 } 177 }
177 178
178 void PasswordManagerDelegateImpl::AddSavePasswordInfoBarIfPermitted( 179 void PasswordManagerDelegateImpl::AddSavePasswordInfoBarIfPermitted(
179 PasswordFormManager* form_to_save) { 180 PasswordFormManager* form_to_save) {
180 SavePasswordInfoBarDelegate::Create(web_contents_, form_to_save); 181 SavePasswordInfoBarDelegate::Create(web_contents_, form_to_save);
181 } 182 }
182 183
183 Profile* PasswordManagerDelegateImpl::GetProfile() { 184 Profile* PasswordManagerDelegateImpl::GetProfile() {
184 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); 185 return Profile::FromBrowserContext(web_contents_->GetBrowserContext());
185 } 186 }
186 187
187 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() { 188 bool PasswordManagerDelegateImpl::DidLastPageLoadEncounterSSLErrors() {
188 content::NavigationEntry* entry = 189 content::NavigationEntry* entry =
189 web_contents_->GetController().GetActiveEntry(); 190 web_contents_->GetController().GetActiveEntry();
190 if (!entry) { 191 if (!entry) {
191 NOTREACHED(); 192 NOTREACHED();
192 return false; 193 return false;
193 } 194 }
194 195
195 return net::IsCertStatusError(entry->GetSSL().cert_status); 196 return net::IsCertStatusError(entry->GetSSL().cert_status);
196 } 197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698