Layered component for web payments
This patch splits up //components/payments into two layers to
accommodate usage in iOS.
//components/payments/core - Can be used from iOS.
//components/payments/content - Cannot be used from iOS.
Based on layering instructions:
https://www.chromium.org/developers/design-documents/structure-of-layered-components-within-the-chromium-codebase
BUG=679381
Review-Url: https://codereview.chromium.org/2713033004
Cr-Commit-Position: refs/heads/master@{#453344}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 902e4c26..00e9a117 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1370,7 +1370,7 @@
public_deps = [
"//chrome/common",
"//components/autofill/core/browser",
- "//components/payments:payment_validation",
+ "//components/payments/core",
"//components/sync",
"//content/public/browser",
"//sql",
@@ -1462,8 +1462,8 @@
"//components/password_manager/core/browser",
"//components/password_manager/core/common",
"//components/password_manager/sync/browser",
- "//components/payments:payment_app",
- "//components/payments:payment_request",
+ "//components/payments/content:payment_app",
+ "//components/payments/content:payment_request",
"//components/policy:generated",
"//components/policy/core/browser",
"//components/policy/proto",
@@ -3038,7 +3038,7 @@
"//chrome/browser/android/webapk:proto",
"//components/cdm/browser",
"//components/data_usage/android",
- "//components/payments/android:payments_jni",
+ "//components/payments/content/android",
"//components/precache/content",
"//components/precache/core",
"//components/resources:components_resources",
@@ -3612,7 +3612,7 @@
"payments/payment_request_factory.cc",
"payments/payment_request_factory.h",
]
- deps += [ "//components/payments:payment_request_impl" ]
+ deps += [ "//components/payments/content:payment_request_impl" ]
}
if (is_linux || is_win) {
diff --git a/chrome/browser/android/chrome_jni_registrar.cc b/chrome/browser/android/chrome_jni_registrar.cc
index feb96d4..4c4df86994 100644
--- a/chrome/browser/android/chrome_jni_registrar.cc
+++ b/chrome/browser/android/chrome_jni_registrar.cc
@@ -168,8 +168,8 @@
#include "components/gcm_driver/android/component_jni_registrar.h"
#include "components/gcm_driver/instance_id/android/component_jni_registrar.h"
#include "components/invalidation/impl/android/component_jni_registrar.h"
-#include "components/payments/android/currency_formatter_android.h"
-#include "components/payments/android/payments_jni_registrar.h"
+#include "components/payments/content/android/currency_formatter_android.h"
+#include "components/payments/content/android/payment_details_validation_android.h"
#include "components/policy/core/browser/android/component_jni_registrar.h"
#include "components/safe_browsing_db/android/jni_registrar.h"
#include "components/safe_json/android/component_jni_registrar.h"
diff --git a/chrome/browser/android/payments/service_worker_payment_app_bridge.cc b/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
index 443e81a..3047a45 100644
--- a/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
+++ b/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
@@ -10,7 +10,7 @@
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "components/payments/payment_app.mojom.h"
+#include "components/payments/content/payment_app.mojom.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/payment_app_provider.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.h b/chrome/browser/autofill/android/personal_data_manager_android.h
index 15013b1..5d82d1d 100644
--- a/chrome/browser/autofill/android/personal_data_manager_android.h
+++ b/chrome/browser/autofill/android/personal_data_manager_android.h
@@ -11,7 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager_observer.h"
-#include "components/payments/address_normalizer.h"
+#include "components/payments/core/address_normalizer.h"
namespace autofill {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index bf9b94a..8adb92cdde 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -277,7 +277,7 @@
#include "chrome/browser/android/service_tab_launcher.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h"
-#include "components/payments/payment_request.mojom.h"
+#include "components/payments/content/payment_request.mojom.h"
#include "content/public/browser/android/java_interfaces.h"
#include "ui/base/ui_base_paths.h"
#else
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc
index 58a6492..919fd539 100644
--- a/chrome/browser/payments/chrome_payment_request_delegate.cc
+++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_dialogs.h"
-#include "components/payments/payment_request_dialog.h"
+#include "components/payments/content/payment_request_dialog.h"
#include "content/public/browser/web_contents.h"
namespace payments {
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.h b/chrome/browser/payments/chrome_payment_request_delegate.h
index 25fb740..5423c52 100644
--- a/chrome/browser/payments/chrome_payment_request_delegate.h
+++ b/chrome/browser/payments/chrome_payment_request_delegate.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_
#include "base/macros.h"
-#include "components/payments/payment_request_delegate.h"
+#include "components/payments/content/payment_request_delegate.h"
namespace content {
class WebContents;
diff --git a/chrome/browser/payments/payment_request_factory.cc b/chrome/browser/payments/payment_request_factory.cc
index 110e753..fc6c4ca 100644
--- a/chrome/browser/payments/payment_request_factory.cc
+++ b/chrome/browser/payments/payment_request_factory.cc
@@ -9,8 +9,8 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/payments/chrome_payment_request_delegate.h"
-#include "components/payments/payment_request_delegate.h"
-#include "components/payments/payment_request_web_contents_manager.h"
+#include "components/payments/content/payment_request_delegate.h"
+#include "components/payments/content/payment_request_web_contents_manager.h"
#include "content/public/browser/web_contents.h"
namespace payments {
diff --git a/chrome/browser/payments/payment_request_factory.h b/chrome/browser/payments/payment_request_factory.h
index 457a2205..f2120f29 100644
--- a/chrome/browser/payments/payment_request_factory.h
+++ b/chrome/browser/payments/payment_request_factory.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_FACTORY_H_
#define CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_FACTORY_H_
-#include "components/payments/payment_request.mojom.h"
+#include "components/payments/content/payment_request.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
namespace content {
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index b50c91c..b06487ea 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -1561,8 +1561,9 @@
deps += [
"//chrome/browser/ui/views",
"//components/constrained_window",
- "//components/payments:payment_request_impl",
- "//components/payments:payment_validation",
+ "//components/payments/content:payment_request_impl",
+ "//components/payments/content:payment_validation",
+ "//components/payments/core",
"//services/ui/public/cpp/input_devices",
]
allow_circular_includes_from += [ "//chrome/browser/ui/views" ]
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
index 4fdaea8..98e4af9 100644
--- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -21,10 +21,11 @@
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/field_types.h"
+#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_constants.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/native_theme/native_theme.h"
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.cc b/chrome/browser/ui/views/payments/editor_view_controller.cc
index a13ab0a..9df050e 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/editor_view_controller.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/ui/views/payments/validating_combobox.h"
#include "chrome/browser/ui/views/payments/validating_textfield.h"
#include "chrome/grit/generated_resources.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/native_theme/native_theme.h"
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.cc b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
index 8e494381..3589cc3 100644
--- a/chrome/browser/ui/views/payments/order_summary_view_controller.cc
+++ b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
@@ -15,8 +15,8 @@
#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "chrome/browser/ui/views/payments/payment_request_views_util.h"
#include "chrome/grit/generated_resources.h"
-#include "components/payments/currency_formatter.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
+#include "components/payments/core/currency_formatter.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/font.h"
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
index 88bb7db..8a915c0 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
@@ -16,7 +16,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
#include "components/strings/grit/components_strings.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc
index b8d3dea..500d0c8 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc
@@ -6,7 +6,7 @@
#include "chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/personal_data_manager.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc
index 3b49bd6..209437c 100644
--- a/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc
+++ b/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc
@@ -13,7 +13,7 @@
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/test_autofill_clock.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/test/browser_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
index 60b3975..d6a122e5 100644
--- a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
+++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h"
#include "chrome/browser/ui/views/payments/shipping_list_view_controller.h"
#include "components/constrained_window/constrained_window_views.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
#include "content/public/browser/browser_thread.h"
#include "ui/views/layout/fill_layout.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.h b/chrome/browser/ui/views/payments/payment_request_dialog_view.h
index 9d70cef9..53b784e8 100644
--- a/chrome/browser/ui/views/payments/payment_request_dialog_view.h
+++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.h
@@ -10,7 +10,7 @@
#include "base/macros.h"
#include "chrome/browser/ui/views/payments/view_stack.h"
-#include "components/payments/payment_request_dialog.h"
+#include "components/payments/content/payment_request_dialog.h"
#include "ui/views/window/dialog_delegate.h"
namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc
index 04e69373..1c707fe2 100644
--- a/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc
+++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc
@@ -10,8 +10,8 @@
#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h"
#include "chrome/test/base/ui_test_utils.h"
-#include "components/payments/payment_request.h"
-#include "components/payments/payment_request_web_contents_manager.h"
+#include "components/payments/content/payment_request.h"
+#include "components/payments/content/payment_request_web_contents_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc
index 6e14875..0f03b7b 100644
--- a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc
+++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc
@@ -21,8 +21,8 @@
#include "chrome/browser/ui/views/payments/view_stack.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
-#include "components/payments/payment_request.h"
-#include "components/payments/payment_request_web_contents_manager.h"
+#include "components/payments/content/payment_request.h"
+#include "components/payments/content/payment_request_web_contents_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h
index 663dd91..cf0149b7 100644
--- a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h
+++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h
@@ -16,7 +16,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/personal_data_manager_observer.h"
-#include "components/payments/payment_request.mojom.h"
+#include "components/payments/content/payment_request.mojom.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
index 01289de..dfcf2a6 100644
--- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -23,8 +23,8 @@
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/personal_data_manager.h"
-#include "components/payments/currency_formatter.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
+#include "components/payments/core/currency_formatter.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/views/payments/shipping_list_view_controller.cc b/chrome/browser/ui/views/payments/shipping_list_view_controller.cc
index 5109745f..fee19bf 100644
--- a/chrome/browser/ui/views/payments/shipping_list_view_controller.cc
+++ b/chrome/browser/ui/views/payments/shipping_list_view_controller.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
#include "chrome/browser/ui/views/payments/payment_request_row_view.h"
#include "chrome/browser/ui/views/payments/payment_request_views_util.h"
-#include "components/payments/payment_request.h"
+#include "components/payments/content/payment_request.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/layout/box_layout.h"