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

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, 9 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
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e3b147239aeb4c4398f35b395a517f399d401689
--- /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;
+
+/**
+ * The Save Password infobar offers the user the ability to save a password for the site.
+ * Appearance and behaviour of infobar buttons depends on from where infobar was
+ * triggered.
+ */
+public class SavePasswordInfoBar extends ConfirmInfoBar {
+ private final boolean mIsMoreButtonNeeded;
+
+ @CalledByNative
+ private static InfoBar show(long nativeInfoBar, int enumeratedIconId, String message,
+ String primaryButtonText, String secondaryButtonText, boolean isMoreButtonNeeded) {
+ return new SavePasswordInfoBar(nativeInfoBar, ResourceId.mapToDrawableId(enumeratedIconId),
+ message, primaryButtonText, secondaryButtonText, isMoreButtonNeeded);
+ }
+
+ private SavePasswordInfoBar(long nativeInfoBar, int iconDrawbleId, String message,
+ String primaryButtonText, String secondaryButtonText, boolean isMoreButtonNeeded) {
+ super(nativeInfoBar, null, iconDrawbleId, null, message, null, primaryButtonText,
+ secondaryButtonText);
+ mIsMoreButtonNeeded = isMoreButtonNeeded;
+ }
+
+ @Override
+ public void createContent(InfoBarLayout layout) {
+ super.createContent(layout);
+ if (mIsMoreButtonNeeded) {
+ layout.setCustomViewInButtonRow(OverflowSelector.createOverflowSelector(getContext()));
+ }
+ }
+}
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698