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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
337 | 337 |
338 ssl_status = navigation_entry->GetSSL(); | 338 ssl_status = navigation_entry->GetSSL(); |
339 // Note: If changing the implementation below, also change | 339 // Note: If changing the implementation below, also change |
340 // AwAutofillClient::IsContextSecure. See crbug.com/505388 | 340 // AwAutofillClient::IsContextSecure. See crbug.com/505388 |
341 return ssl_status.security_style == content::SECURITY_STYLE_AUTHENTICATED && | 341 return ssl_status.security_style == content::SECURITY_STYLE_AUTHENTICATED && |
342 !(ssl_status.content_status & | 342 !(ssl_status.content_status & |
343 content::SSLStatus::RAN_INSECURE_CONTENT); | 343 content::SSLStatus::RAN_INSECURE_CONTENT); |
344 } | 344 } |
345 | 345 |
346 bool ChromeAutofillClient::ShouldShowSigninPromo() { | 346 bool ChromeAutofillClient::ShouldShowSigninPromo() { |
347 #if defined(OS_IOS) | 347 #if !defined(OS_ANDROID) |
Evan Stade
2016/07/21 17:34:33
should this actually be ANDROID_JAVA_UI?
Mathieu
2016/07/21 17:55:50
I've asked, and both dfalcantara and tedchoc agree
| |
348 // TODO(crbug.com/626383): Implement signin promo for iOS by changing the | |
349 // logic of StartSigninFlow() below. | |
350 return false; | |
351 #elif !defined(OS_ANDROID) | |
352 // Determine if we are in a valid context (on desktop platforms, we could be | 348 // Determine if we are in a valid context (on desktop platforms, we could be |
353 // in an app window with no Browser). | 349 // in an app window with no Browser). |
354 if (!chrome::FindBrowserWithWebContents(web_contents())) | 350 if (!chrome::FindBrowserWithWebContents(web_contents())) |
355 return false; | 351 return false; |
356 #endif | 352 #endif |
357 | 353 |
358 return signin::ShouldShowPromo( | 354 return signin::ShouldShowPromo( |
359 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); | 355 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); |
360 } | 356 } |
361 | 357 |
362 void ChromeAutofillClient::StartSigninFlow() { | 358 void ChromeAutofillClient::StartSigninFlow() { |
363 // See ShouldShowSigninPromo. | 359 #if defined(OS_ANDROID) |
364 #if defined(OS_IOS) | |
365 return; | |
366 #elif defined(OS_ANDROID) | |
367 chrome::android::SigninPromoUtilAndroid::StartAccountSigninActivityForPromo( | 360 chrome::android::SigninPromoUtilAndroid::StartAccountSigninActivityForPromo( |
368 content::ContentViewCore::FromWebContents(web_contents()), | 361 content::ContentViewCore::FromWebContents(web_contents()), |
369 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); | 362 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); |
370 #else | 363 #else |
371 chrome::FindBrowserWithWebContents(web_contents()) | 364 chrome::FindBrowserWithWebContents(web_contents()) |
372 ->window() | 365 ->window() |
373 ->ShowAvatarBubbleFromAvatarButton( | 366 ->ShowAvatarBubbleFromAvatarButton( |
374 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, | 367 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, |
375 signin::ManageAccountsParams(), | 368 signin::ManageAccountsParams(), |
376 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); | 369 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); |
377 #endif | 370 #endif |
378 } | 371 } |
379 | 372 |
380 } // namespace autofill | 373 } // namespace autofill |
OLD | NEW |