| OLD | NEW |
| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) { | 351 bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) { |
| 352 content::SSLStatus ssl_status; | 352 content::SSLStatus ssl_status; |
| 353 content::NavigationEntry* navigation_entry = | 353 content::NavigationEntry* navigation_entry = |
| 354 web_contents()->GetController().GetLastCommittedEntry(); | 354 web_contents()->GetController().GetLastCommittedEntry(); |
| 355 if (!navigation_entry) | 355 if (!navigation_entry) |
| 356 return false; | 356 return false; |
| 357 | 357 |
| 358 ssl_status = navigation_entry->GetSSL(); | 358 ssl_status = navigation_entry->GetSSL(); |
| 359 // Note: If changing the implementation below, also change | 359 // Note: If changing the implementation below, also change |
| 360 // AwAutofillClient::IsContextSecure. See crbug.com/505388 | 360 // AwAutofillClient::IsContextSecure. See crbug.com/505388 |
| 361 return ssl_status.security_style == content::SECURITY_STYLE_AUTHENTICATED && | 361 return navigation_entry->GetURL().SchemeIsCryptographic() && |
| 362 ssl_status.certificate && |
| 363 (!net::IsCertStatusError(ssl_status.cert_status) || |
| 364 net::IsCertStatusMinorError(ssl_status.cert_status)) && |
| 362 !(ssl_status.content_status & | 365 !(ssl_status.content_status & |
| 363 content::SSLStatus::RAN_INSECURE_CONTENT); | 366 content::SSLStatus::RAN_INSECURE_CONTENT); |
| 364 } | 367 } |
| 365 | 368 |
| 366 bool ChromeAutofillClient::ShouldShowSigninPromo() { | 369 bool ChromeAutofillClient::ShouldShowSigninPromo() { |
| 367 #if !defined(OS_ANDROID) | 370 #if !defined(OS_ANDROID) |
| 368 // Determine if we are in a valid context (on desktop platforms, we could be | 371 // Determine if we are in a valid context (on desktop platforms, we could be |
| 369 // in an app window with no Browser). | 372 // in an app window with no Browser). |
| 370 if (!chrome::FindBrowserWithWebContents(web_contents())) | 373 if (!chrome::FindBrowserWithWebContents(web_contents())) |
| 371 return false; | 374 return false; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 384 chrome::FindBrowserWithWebContents(web_contents()) | 387 chrome::FindBrowserWithWebContents(web_contents()) |
| 385 ->window() | 388 ->window() |
| 386 ->ShowAvatarBubbleFromAvatarButton( | 389 ->ShowAvatarBubbleFromAvatarButton( |
| 387 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, | 390 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, |
| 388 signin::ManageAccountsParams(), | 391 signin::ManageAccountsParams(), |
| 389 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); | 392 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); |
| 390 #endif | 393 #endif |
| 391 } | 394 } |
| 392 | 395 |
| 393 } // namespace autofill | 396 } // namespace autofill |
| OLD | NEW |