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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc

Issue 861103002: Credentials chooser UI for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
index b6eeaefc8266a12250ed5b063ecbec6b427855aa..1d5ae15a79ac4f13e5e4b3e83a6fcf29a7a8ecfb 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -25,6 +25,8 @@
#if defined(OS_ANDROID)
#include "chrome/browser/android/chromium_application.h"
+#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/browser/password_manager/account_chooser_infobar_delegate_android.h"
#endif
using autofill::PasswordFormMap;
@@ -95,6 +97,15 @@ void ManagePasswordsUIController::UpdateBubbleAndIconVisibility() {
#endif
}
+void ManagePasswordsUIController::
+ UpdateAndroidAccountChooserInfoBarVisibility() {
+#if defined(OS_ANDROID)
+ AccountChooserInfoBarDelegateAndroid::Create(
+ InfoBarService::FromWebContents(web_contents()), this);
+ should_pop_up_bubble_ = false;
+#endif
+}
+
base::TimeDelta ManagePasswordsUIController::Elapsed() const {
return timer_ ? timer_->Elapsed() : base::TimeDelta::Max();
}
@@ -128,7 +139,11 @@ bool ManagePasswordsUIController::OnChooseCredentials(
origin_ = origin;
SetState(password_manager::ui::CREDENTIAL_REQUEST_STATE);
base::AutoReset<bool> resetter(&should_pop_up_bubble_, true);
+#if defined(OS_ANDROID)
+ UpdateAndroidAccountChooserInfoBarVisibility();
+#else
UpdateBubbleAndIconVisibility();
+#endif
if (!should_pop_up_bubble_) {
credentials_callback_ = callback;
return true;

Powered by Google App Engine
This is Rietveld 408576698