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

Side by Side 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, 8 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
« no previous file with comments | « components/payments/core/strings_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/payments/core/strings_util.h"
6
7 #include "base/logging.h"
8 #include "components/strings/grit/components_strings.h"
9 #include "ui/base/l10n/l10n_util.h"
10
11 namespace payments {
12
13 base::string16 GetShippingAddressSectionString(
14 PaymentShippingType shipping_type) {
15 switch (shipping_type) {
16 case PaymentShippingType::DELIVERY:
17 return l10n_util::GetStringUTF16(IDS_PAYMENTS_DELIVERY_ADDRESS_LABEL);
18 case PaymentShippingType::PICKUP:
19 return l10n_util::GetStringUTF16(IDS_PAYMENTS_PICKUP_ADDRESS_LABEL);
20 case PaymentShippingType::SHIPPING:
21 return l10n_util::GetStringUTF16(IDS_PAYMENTS_SHIPPING_ADDRESS_LABEL);
22 default:
23 NOTREACHED();
24 return base::string16();
25 }
26 }
27
28 base::string16 GetShippingOptionSectionString(
29 PaymentShippingType shipping_type) {
30 switch (shipping_type) {
31 case PaymentShippingType::DELIVERY:
32 return l10n_util::GetStringUTF16(IDS_PAYMENTS_DELIVERY_OPTION_LABEL);
33 case PaymentShippingType::PICKUP:
34 return l10n_util::GetStringUTF16(IDS_PAYMENTS_PICKUP_OPTION_LABEL);
35 case PaymentShippingType::SHIPPING:
36 return l10n_util::GetStringUTF16(IDS_PAYMENTS_SHIPPING_OPTION_LABEL);
37 default:
38 NOTREACHED();
39 return base::string16();
40 }
41 }
42
43 } // namespace payments
OLDNEW
« 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