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

Side by Side Diff: chrome/browser/ui/autofill/chrome_autofill_client.cc

Issue 2672623005: Record Autofill form events specially for nonsecure pages (Closed)
Patch Set: rebase 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 "chrome/browser/ui/autofill/chrome_autofill_client.h" 5 #include "chrome/browser/ui/autofill/chrome_autofill_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 // And actually they have no corresponding drivers in the factory's map. 336 // And actually they have no corresponding drivers in the factory's map.
337 if (!frame->IsRenderFrameLive()) 337 if (!frame->IsRenderFrameLive())
338 continue; 338 continue;
339 ContentAutofillDriver* driver = factory->DriverForFrame(frame); 339 ContentAutofillDriver* driver = factory->DriverForFrame(frame);
340 DCHECK(driver); 340 DCHECK(driver);
341 driver->NotifyFirstUserGestureObservedInTab(); 341 driver->NotifyFirstUserGestureObservedInTab();
342 } 342 }
343 } 343 }
344 344
345 bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) { 345 bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) {
346 return IsMainUrlSecure();
347 }
348
349 bool ChromeAutofillClient::IsMainUrlSecure() {
346 content::SSLStatus ssl_status; 350 content::SSLStatus ssl_status;
347 content::NavigationEntry* navigation_entry = 351 content::NavigationEntry* navigation_entry =
348 web_contents()->GetController().GetLastCommittedEntry(); 352 web_contents()->GetController().GetLastCommittedEntry();
349 if (!navigation_entry) 353 if (!navigation_entry)
350 return false; 354 return false;
351 355
352 ssl_status = navigation_entry->GetSSL(); 356 ssl_status = navigation_entry->GetSSL();
353 // Note: If changing the implementation below, also change 357 // Note: If changing the implementation below, also change
354 // AwAutofillClient::IsContextSecure. See crbug.com/505388 358 // AwAutofillClient::IsMainUrlSecure. See crbug.com/505388
355 return navigation_entry->GetURL().SchemeIsCryptographic() && 359 return navigation_entry->GetURL().SchemeIsCryptographic() &&
356 ssl_status.certificate && 360 ssl_status.certificate &&
357 (!net::IsCertStatusError(ssl_status.cert_status) || 361 (!net::IsCertStatusError(ssl_status.cert_status) ||
358 net::IsCertStatusMinorError(ssl_status.cert_status)) && 362 net::IsCertStatusMinorError(ssl_status.cert_status)) &&
359 !(ssl_status.content_status & 363 !(ssl_status.content_status &
360 content::SSLStatus::RAN_INSECURE_CONTENT); 364 content::SSLStatus::RAN_INSECURE_CONTENT);
361 } 365 }
362 366
363 bool ChromeAutofillClient::ShouldShowSigninPromo() { 367 bool ChromeAutofillClient::ShouldShowSigninPromo() {
364 #if !defined(OS_ANDROID) 368 #if !defined(OS_ANDROID)
(...skipping 28 matching lines...) Expand all
393 // directly. 397 // directly.
394 const GURL kSecurityIndicatorHelpCenterUrl( 398 const GURL kSecurityIndicatorHelpCenterUrl(
395 "https://support.google.com/chrome/?p=ui_security_indicator"); 399 "https://support.google.com/chrome/?p=ui_security_indicator");
396 web_contents()->OpenURL(content::OpenURLParams( 400 web_contents()->OpenURL(content::OpenURLParams(
397 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), 401 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(),
398 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, 402 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
399 false /* is_renderer_initiated */)); 403 false /* is_renderer_initiated */));
400 } 404 }
401 405
402 } // namespace autofill 406 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698