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

Side by Side Diff: android_webview/native/aw_autofill_client.cc

Issue 2672623005: Record Autofill form events specially for nonsecure pages (Closed)
Patch Set: sebsg comments Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "android_webview/native/aw_autofill_client.h" 5 #include "android_webview/native/aw_autofill_client.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_content_browser_client.h" 8 #include "android_webview/browser/aw_content_browser_client.h"
9 #include "android_webview/browser/aw_form_database_service.h" 9 #include "android_webview/browser/aw_form_database_service.h"
10 #include "android_webview/native/aw_contents.h" 10 #include "android_webview/native/aw_contents.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 void AwAutofillClient::DidFillOrPreviewField( 180 void AwAutofillClient::DidFillOrPreviewField(
181 const base::string16& autofilled_value, 181 const base::string16& autofilled_value,
182 const base::string16& profile_full_name) {} 182 const base::string16& profile_full_name) {}
183 183
184 void AwAutofillClient::OnFirstUserGestureObserved() { 184 void AwAutofillClient::OnFirstUserGestureObserved() {
185 NOTIMPLEMENTED(); 185 NOTIMPLEMENTED();
186 } 186 }
187 187
188 bool AwAutofillClient::IsContextSecure(const GURL& form_origin) { 188 bool AwAutofillClient::IsContextSecure(const GURL& form_origin) {
189 return IsMainUrlSecure();
190 }
191
192 bool AwAutofillClient::IsMainUrlSecure() {
189 content::SSLStatus ssl_status; 193 content::SSLStatus ssl_status;
190 content::NavigationEntry* navigation_entry = 194 content::NavigationEntry* navigation_entry =
191 web_contents_->GetController().GetLastCommittedEntry(); 195 web_contents_->GetController().GetLastCommittedEntry();
192 if (!navigation_entry) 196 if (!navigation_entry)
193 return false; 197 return false;
194 198
195 ssl_status = navigation_entry->GetSSL(); 199 ssl_status = navigation_entry->GetSSL();
196 // Note: The implementation below is a copy of the one in 200 // Note: The implementation below is a copy of the one in
197 // ChromeAutofillClient::IsContextSecure, and should be kept in sync 201 // ChromeAutofillClient::IsMainUrlSecure, and should be kept in sync
198 // until crbug.com/505388 gets implemented. 202 // until crbug.com/505388 gets implemented.
199 return navigation_entry->GetURL().SchemeIsCryptographic() && 203 return navigation_entry->GetURL().SchemeIsCryptographic() &&
200 ssl_status.certificate && 204 ssl_status.certificate &&
201 (!net::IsCertStatusError(ssl_status.cert_status) || 205 (!net::IsCertStatusError(ssl_status.cert_status) ||
202 net::IsCertStatusMinorError(ssl_status.cert_status)) && 206 net::IsCertStatusMinorError(ssl_status.cert_status)) &&
203 !(ssl_status.content_status & 207 !(ssl_status.content_status &
204 content::SSLStatus::RAN_INSECURE_CONTENT); 208 content::SSLStatus::RAN_INSECURE_CONTENT);
205 } 209 }
206 210
207 bool AwAutofillClient::ShouldShowSigninPromo() { 211 bool AwAutofillClient::ShouldShowSigninPromo() {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 276
273 void AwAutofillClient::ScanCreditCard(const CreditCardScanCallback& callback) { 277 void AwAutofillClient::ScanCreditCard(const CreditCardScanCallback& callback) {
274 NOTIMPLEMENTED(); 278 NOTIMPLEMENTED();
275 } 279 }
276 280
277 bool RegisterAwAutofillClient(JNIEnv* env) { 281 bool RegisterAwAutofillClient(JNIEnv* env) {
278 return RegisterNativesImpl(env); 282 return RegisterNativesImpl(env);
279 } 283 }
280 284
281 } // namespace android_webview 285 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698