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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java

Issue 2698703003: [Payments] Add UI elements to secure branding for payments (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.payments.ui; 5 package org.chromium.chrome.browser.payments.ui;
6 6
7 import static org.chromium.chrome.browser.payments.ui.PaymentRequestSection.EDIT _BUTTON_GONE; 7 import static org.chromium.chrome.browser.payments.ui.PaymentRequestSection.EDIT _BUTTON_GONE;
8 8
9 import android.animation.Animator; 9 import android.animation.Animator;
10 import android.animation.AnimatorListenerAdapter; 10 import android.animation.AnimatorListenerAdapter;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 import org.chromium.base.Callback; 45 import org.chromium.base.Callback;
46 import org.chromium.base.VisibleForTesting; 46 import org.chromium.base.VisibleForTesting;
47 import org.chromium.chrome.R; 47 import org.chromium.chrome.R;
48 import org.chromium.chrome.browser.payments.ShippingStrings; 48 import org.chromium.chrome.browser.payments.ShippingStrings;
49 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.ExtraTextsS ection; 49 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.ExtraTextsS ection;
50 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.LineItemBre akdownSection; 50 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.LineItemBre akdownSection;
51 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.OptionSecti on; 51 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.OptionSecti on;
52 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.SectionSepa rator; 52 import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.SectionSepa rator;
53 import org.chromium.chrome.browser.widget.AlwaysDismissedDialog; 53 import org.chromium.chrome.browser.widget.AlwaysDismissedDialog;
54 import org.chromium.chrome.browser.widget.DualControlLayout; 54 import org.chromium.chrome.browser.widget.DualControlLayout;
55 import org.chromium.chrome.browser.widget.TintedDrawable;
55 import org.chromium.chrome.browser.widget.animation.AnimatorProperties; 56 import org.chromium.chrome.browser.widget.animation.AnimatorProperties;
56 import org.chromium.chrome.browser.widget.animation.FocusAnimator; 57 import org.chromium.chrome.browser.widget.animation.FocusAnimator;
57 import org.chromium.components.signin.ChromeSigninController; 58 import org.chromium.components.signin.ChromeSigninController;
59 import org.chromium.components.url_formatter.UrlFormatter;
58 import org.chromium.ui.text.NoUnderlineClickableSpan; 60 import org.chromium.ui.text.NoUnderlineClickableSpan;
59 import org.chromium.ui.text.SpanApplier; 61 import org.chromium.ui.text.SpanApplier;
60 import org.chromium.ui.text.SpanApplier.SpanInfo; 62 import org.chromium.ui.text.SpanApplier.SpanInfo;
61 import org.chromium.ui.widget.TextViewWithClickableSpans; 63 import org.chromium.ui.widget.TextViewWithClickableSpans;
62 64
63 import java.lang.annotation.Retention; 65 import java.lang.annotation.Retention;
64 import java.lang.annotation.RetentionPolicy; 66 import java.lang.annotation.RetentionPolicy;
65 import java.util.ArrayList; 67 import java.util.ArrayList;
66 import java.util.List; 68 import java.util.List;
67 69
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 Context context, String title, String origin, boolean canAddCards) { 538 Context context, String title, String origin, boolean canAddCards) {
537 mSpinnyLayout = mRequestView.findViewById(R.id.payment_request_spinny); 539 mSpinnyLayout = mRequestView.findViewById(R.id.payment_request_spinny);
538 assert mSpinnyLayout.getVisibility() == View.VISIBLE; 540 assert mSpinnyLayout.getVisibility() == View.VISIBLE;
539 mIsShowingSpinner = true; 541 mIsShowingSpinner = true;
540 542
541 // Indicate that we're preparing the dialog for display. 543 // Indicate that we're preparing the dialog for display.
542 TextView messageView = (TextView) mRequestView.findViewById(R.id.message ); 544 TextView messageView = (TextView) mRequestView.findViewById(R.id.message );
543 messageView.setText(R.string.payments_loading_message); 545 messageView.setText(R.string.payments_loading_message);
544 546
545 ((TextView) mRequestView.findViewById(R.id.page_title)).setText(title); 547 ((TextView) mRequestView.findViewById(R.id.page_title)).setText(title);
546 ((TextView) mRequestView.findViewById(R.id.hostname)).setText(origin); 548
549 TextView hostName = (TextView) mRequestView.findViewById(R.id.hostname);
550 hostName.setText(UrlFormatter.tintUrlSchemeForSecurityDisplay(origin,
551 ApiCompatibilityUtils.getColor(context.getResources(), R.color.g oogle_green_700)));
552 ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(ho stName,
please use gerrit instead 2017/02/15 21:54:46 Also, let's not show the lock icon for non-https.
gogerald1 2017/02/16 16:43:14 Done. Unfortunately, we can not simply use omnibox
553 TintedDrawable.constructTintedDrawable(context.getResources(),
554 R.drawable.omnibox_https_valid, R.color.google_green_700 ),
555 null, null, null);
547 556
548 // Set up the buttons. 557 // Set up the buttons.
549 mCloseButton = mRequestView.findViewById(R.id.close_button); 558 mCloseButton = mRequestView.findViewById(R.id.close_button);
550 mCloseButton.setOnClickListener(this); 559 mCloseButton.setOnClickListener(this);
551 mPayButton = DualControlLayout.createButtonForLayout( 560 mPayButton = DualControlLayout.createButtonForLayout(
552 context, true, context.getString(R.string.payments_pay_button), this); 561 context, true, context.getString(R.string.payments_pay_button), this);
553 mEditButton = DualControlLayout.createButtonForLayout( 562 mEditButton = DualControlLayout.createButtonForLayout(
554 context, false, context.getString(R.string.payments_edit_button) , this); 563 context, false, context.getString(R.string.payments_edit_button) , this);
555 mButtonBar = (DualControlLayout) mRequestView.findViewById(R.id.button_b ar); 564 mButtonBar = (DualControlLayout) mRequestView.findViewById(R.id.button_b ar);
556 mButtonBar.setAlignment(DualControlLayout.ALIGN_END); 565 mButtonBar.setAlignment(DualControlLayout.ALIGN_END);
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 sObserverForTest.onPaymentRequestReadyForInput(this); 1425 sObserverForTest.onPaymentRequestReadyForInput(this);
1417 } 1426 }
1418 } 1427 }
1419 1428
1420 private void notifySelectionChecked() { 1429 private void notifySelectionChecked() {
1421 if (sObserverForTest != null) { 1430 if (sObserverForTest != null) {
1422 sObserverForTest.onPaymentRequestSelectionChecked(this); 1431 sObserverForTest.onPaymentRequestSelectionChecked(this);
1423 } 1432 }
1424 } 1433 }
1425 } 1434 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698