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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java

Issue 967193002: Credential saving clank infobar for Smart Lock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reusable_more_button
Patch Set: 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/android/java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java
new file mode 100644
index 0000000000000000000000000000000000000000..0cd37b64e196291c6eb5cfe095c73873e0dcf028
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java
@@ -0,0 +1,39 @@
+// Copyright 2015 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.
+
+package org.chromium.chrome.browser.infobar;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.chrome.browser.ResourceId;
+
+/**
+ * Save password infobar offers a user an ability to save password to the site.
Bernhard Bauer 2015/03/02 10:28:09 Nit: "*The* Save Password infobars offers *the* us
gone 2015/03/02 17:39:38 offer, for the site?
melandory 2015/03/03 11:55:46 Done.
melandory 2015/03/03 11:55:46 Done.
+ * Appearance and behaviour of infobar buttons depends on from where infobar was
+ * triggered.
+ */
+public class SavePasswordInfoBar extends ConfirmInfoBar {
+
+ boolean mAddMoreButton;
Bernhard Bauer 2015/03/02 10:28:09 Member variables should be private. Also, you coul
gone 2015/03/02 17:39:38 Can you rename this boolean? It makes it sound li
melandory 2015/03/03 11:55:46 Done.
melandory 2015/03/03 11:55:46 Done.
+
+ @CalledByNative
+ private static InfoBar show(long nativeInfoBar, int enumeratedIconId, String message,
+ String primaryButtonText, String secondaryButtonText, boolean addMoreButton) {
+ return new SavePasswordInfoBar(nativeInfoBar, ResourceId.mapToDrawableId(enumeratedIconId),
+ message, primaryButtonText, secondaryButtonText, addMoreButton);
+ }
+
+ SavePasswordInfoBar(long nativeInfoBar, int iconDrawbleId, String message,
Bernhard Bauer 2015/03/02 10:28:09 Is this constructor meant to be called from somewh
gone 2015/03/02 17:39:38 Should be private; you don't want people to be abl
melandory 2015/03/03 11:55:46 Done.
melandory 2015/03/03 11:55:46 Done.
+ String primaryButtonText, String secondaryButtonText, boolean addMoreButton) {
+ super(nativeInfoBar, null, iconDrawbleId, null, message, null, primaryButtonText,
+ secondaryButtonText);
+ mAddMoreButton = addMoreButton;
+ }
+
+ @Override
+ public void createContent(InfoBarLayout layout) {
+ super.createContent(layout);
+ if (mAddMoreButton)
Bernhard Bauer 2015/03/02 10:28:09 Android style is to either put everything on one l
melandory 2015/03/03 11:55:46 Done.
+ layout.setCustomViewInButtonRow(OverflowSelector.createOverflowSelector(getContext()));
+ }
+}
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | chrome/browser/password_manager/chrome_password_manager_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698