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

Unified Diff: components/payments/core/strings_util.cc

Issue 2784973002: Move string helper functions to components/core for iOS use. (Closed)
Patch Set: Deps, part 3 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 | « components/payments/core/strings_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/core/strings_util.cc
diff --git a/components/payments/core/strings_util.cc b/components/payments/core/strings_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..266aeafd8234a5c58acf93a4c84cc802d9539661
--- /dev/null
+++ b/components/payments/core/strings_util.cc
@@ -0,0 +1,43 @@
+// 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.
+
+#include "components/payments/core/strings_util.h"
+
+#include "base/logging.h"
+#include "components/strings/grit/components_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace payments {
+
+base::string16 GetShippingAddressSectionString(
+ PaymentShippingType shipping_type) {
+ switch (shipping_type) {
+ case PaymentShippingType::DELIVERY:
+ return l10n_util::GetStringUTF16(IDS_PAYMENTS_DELIVERY_ADDRESS_LABEL);
+ case PaymentShippingType::PICKUP:
+ return l10n_util::GetStringUTF16(IDS_PAYMENTS_PICKUP_ADDRESS_LABEL);
+ case PaymentShippingType::SHIPPING:
+ return l10n_util::GetStringUTF16(IDS_PAYMENTS_SHIPPING_ADDRESS_LABEL);
+ default:
+ NOTREACHED();
+ return base::string16();
+ }
+}
+
+base::string16 GetShippingOptionSectionString(
+ PaymentShippingType shipping_type) {
+ switch (shipping_type) {
+ case PaymentShippingType::DELIVERY:
+ return l10n_util::GetStringUTF16(IDS_PAYMENTS_DELIVERY_OPTION_LABEL);
+ case PaymentShippingType::PICKUP:
+ return l10n_util::GetStringUTF16(IDS_PAYMENTS_PICKUP_OPTION_LABEL);
+ case PaymentShippingType::SHIPPING:
+ return l10n_util::GetStringUTF16(IDS_PAYMENTS_SHIPPING_OPTION_LABEL);
+ default:
+ NOTREACHED();
+ return base::string16();
+ }
+}
+
+} // namespace payments
« no previous file with comments | « components/payments/core/strings_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698