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

Unified Diff: chrome/browser/ui/android/infobars/account_chooser_infobar.h

Issue 861103002: Credentials chooser UI for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebaised on top of master. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/android/infobars/account_chooser_infobar.h
diff --git a/chrome/browser/ui/android/infobars/account_chooser_infobar.h b/chrome/browser/ui/android/infobars/account_chooser_infobar.h
new file mode 100644
index 0000000000000000000000000000000000000000..f2b4992ced27897ba9a89e64b2bbe7978f6438c3
--- /dev/null
+++ b/chrome/browser/ui/android/infobars/account_chooser_infobar.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_ACCOUNT_CHOOSER_INFOBAR_H_
+#define CHROME_BROWSER_UI_ANDROID_INFOBARS_ACCOUNT_CHOOSER_INFOBAR_H_
+
+#include <jni.h>
+
+#include <string>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "chrome/browser/password_manager/account_chooser_infobar_delegate_android.h"
+#include "chrome/browser/ui/android/infobars/infobar_android.h"
+
+// The Android infobar that allows user to choose credentials for login.
+class AccountChooserInfoBar : public InfoBarAndroid {
+ public:
+ explicit AccountChooserInfoBar(
+ scoped_ptr<AccountChooserInfoBarDelegateAndroid> delegate);
+ ~AccountChooserInfoBar() override = default;
+
+ void OnCredentialClicked(JNIEnv* env,
+ jobject obj,
+ jint credential_item,
+ jint credential_type);
+
+ private:
+ // InfoBarAndroid implementation:
+ virtual base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
+ JNIEnv* env) override;
+ virtual void ProcessButton(int action,
+ const std::string& action_value) override;
+
+ void ChooseCredential(int type, int index);
+
+ AccountChooserInfoBarDelegateAndroid* GetDelegate();
+
+ DISALLOW_COPY_AND_ASSIGN(AccountChooserInfoBar);
+};
+
+// Registers native methods.
+bool RegisterAccountChooserInfoBar(JNIEnv* env);
+
+#endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_ACCOUNT_CHOOSER_INFOBAR_H_

Powered by Google App Engine
This is Rietveld 408576698