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

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

Issue 2765193002: Prototype for the new UI for the Safe Browsing Subresource Filter. (Closed)
Patch Set: comments Created 3 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/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java » ('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/SubresourceFilterExperimentalInfoBar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SubresourceFilterExperimentalInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SubresourceFilterExperimentalInfoBar.java
new file mode 100644
index 0000000000000000000000000000000000000000..17e2fb109b8e4b975ab7be52c89a409efd547b41
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SubresourceFilterExperimentalInfoBar.java
@@ -0,0 +1,60 @@
+// Copyright 2017 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.annotations.CalledByNative;
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ResourceId;
+
+/**
+ * After user proceed through Safe Browsing warning interstitials that are displayed when the site
+ * ahead contains deceptive embedded content, the infobar appears, it explains the user that some
+ * subresources were filtered and presents the "Detals" link. If the link is pressed full infobar
+ * with detailed text and the action buttons appears, it gives the user an ability to reload the
+ * page with the content we've blocked previously.
+ */
+public class SubresourceFilterExperimentalInfoBar extends ConfirmInfoBar {
+ private final String mMessage;
+ private final String mFollowUpMessage;
+ private final String mOKButtonText;
+ private final String mReloadButtonText;
+ private boolean mShowExplanation;
+
+ @CalledByNative
+ private static InfoBar show(int enumeratedIconId, String message, String oKButtonText,
+ String reloadButtonText, String followUpMessage) {
+ return new SubresourceFilterExperimentalInfoBar(
+ ResourceId.mapToDrawableId(enumeratedIconId), message, oKButtonText,
+ reloadButtonText, followUpMessage);
+ }
+
+ private SubresourceFilterExperimentalInfoBar(int iconDrawbleId, String message,
+ String oKButtonText, String reloadButtonText, String followUpMessage) {
+ super(iconDrawbleId, null, message, null, null, null); //, oKButtonText, reloadButtonText);
+ mFollowUpMessage = followUpMessage;
+ mMessage = message;
+ mOKButtonText = oKButtonText;
+ mReloadButtonText = reloadButtonText;
+ }
+
+ @Override
+ public void createContent(InfoBarLayout layout) {
+ super.createContent(layout);
+ if (mShowExplanation) {
+ layout.setMessage(mFollowUpMessage);
+ setButtons(layout, mOKButtonText, mReloadButtonText);
+ } else {
+ String link = layout.getContext().getString(R.string.details_link);
+ layout.setMessage(mMessage);
+ layout.setMessageLinkText(link);
+ }
+ }
+
+ @Override
+ public void onLinkClicked() {
+ mShowExplanation = true;
+ replaceView(createView());
+ }
+}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698