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

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

Issue 2603823002: Prohibit web payments on sites with bad SSL certificates (Closed)
Patch Set: Created 3 years, 11 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // And actually they have no corresponding drivers in the factory's map. 348 // And actually they have no corresponding drivers in the factory's map.
349 if (!frame->IsRenderFrameLive()) 349 if (!frame->IsRenderFrameLive())
350 continue; 350 continue;
351 ContentAutofillDriver* driver = factory->DriverForFrame(frame); 351 ContentAutofillDriver* driver = factory->DriverForFrame(frame);
352 DCHECK(driver); 352 DCHECK(driver);
353 driver->NotifyFirstUserGestureObservedInTab(); 353 driver->NotifyFirstUserGestureObservedInTab();
354 } 354 }
355 } 355 }
356 356
357 bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) { 357 bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) {
358 content::SSLStatus ssl_status; 358 return web_contents()->IsContextSecure();
359 content::NavigationEntry* navigation_entry =
360 web_contents()->GetController().GetLastCommittedEntry();
361 if (!navigation_entry)
362 return false;
363
364 ssl_status = navigation_entry->GetSSL();
365 // Note: If changing the implementation below, also change
366 // AwAutofillClient::IsContextSecure. See crbug.com/505388
367 return navigation_entry->GetURL().SchemeIsCryptographic() &&
368 ssl_status.certificate &&
369 (!net::IsCertStatusError(ssl_status.cert_status) ||
370 net::IsCertStatusMinorError(ssl_status.cert_status)) &&
371 !(ssl_status.content_status &
372 content::SSLStatus::RAN_INSECURE_CONTENT);
373 } 359 }
374 360
375 bool ChromeAutofillClient::ShouldShowSigninPromo() { 361 bool ChromeAutofillClient::ShouldShowSigninPromo() {
376 #if !defined(OS_ANDROID) 362 #if !defined(OS_ANDROID)
377 // Determine if we are in a valid context (on desktop platforms, we could be 363 // Determine if we are in a valid context (on desktop platforms, we could be
378 // in an app window with no Browser). 364 // in an app window with no Browser).
379 if (!chrome::FindBrowserWithWebContents(web_contents())) 365 if (!chrome::FindBrowserWithWebContents(web_contents()))
380 return false; 366 return false;
381 #endif 367 #endif
382 368
(...skipping 17 matching lines...) Expand all
400 } 386 }
401 387
402 void ChromeAutofillClient::ShowHttpNotSecureExplanation() { 388 void ChromeAutofillClient::ShowHttpNotSecureExplanation() {
403 web_contents()->OpenURL(content::OpenURLParams( 389 web_contents()->OpenURL(content::OpenURLParams(
404 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), 390 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(),
405 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, 391 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
406 false /* is_renderer_initiated */)); 392 false /* is_renderer_initiated */));
407 } 393 }
408 394
409 } // namespace autofill 395 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698