OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 m_locale.adoptNS( | 97 m_locale.adoptNS( |
98 [[NSLocale alloc] initWithLocaleIdentifier:defaultLanguage()]); | 98 [[NSLocale alloc] initWithLocaleIdentifier:defaultLanguage()]); |
99 [m_gregorianCalendar.get() setLocale:m_locale.get()]; | 99 [m_gregorianCalendar.get() setLocale:m_locale.get()]; |
100 } | 100 } |
101 | 101 |
102 LocaleMac::~LocaleMac() {} | 102 LocaleMac::~LocaleMac() {} |
103 | 103 |
104 std::unique_ptr<LocaleMac> LocaleMac::create(const String& localeIdentifier) { | 104 std::unique_ptr<LocaleMac> LocaleMac::create(const String& localeIdentifier) { |
105 RetainPtr<NSLocale> locale = | 105 RetainPtr<NSLocale> locale = |
106 [[NSLocale alloc] initWithLocaleIdentifier:localeIdentifier]; | 106 [[NSLocale alloc] initWithLocaleIdentifier:localeIdentifier]; |
107 return wrapUnique(new LocaleMac(locale.get())); | 107 return WTF::wrapUnique(new LocaleMac(locale.get())); |
108 } | 108 } |
109 | 109 |
110 std::unique_ptr<LocaleMac> LocaleMac::create(NSLocale* locale) { | 110 std::unique_ptr<LocaleMac> LocaleMac::create(NSLocale* locale) { |
111 return wrapUnique(new LocaleMac(locale)); | 111 return WTF::wrapUnique(new LocaleMac(locale)); |
112 } | 112 } |
113 | 113 |
114 RetainPtr<NSDateFormatter> LocaleMac::shortDateFormatter() { | 114 RetainPtr<NSDateFormatter> LocaleMac::shortDateFormatter() { |
115 return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), | 115 return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), |
116 NSDateFormatterShortStyle, | 116 NSDateFormatterShortStyle, |
117 NSDateFormatterNoStyle); | 117 NSDateFormatterNoStyle); |
118 } | 118 } |
119 | 119 |
120 const Vector<String>& LocaleMac::monthLabels() { | 120 const Vector<String>& LocaleMac::monthLabels() { |
121 if (!m_monthLabels.isEmpty()) | 121 if (!m_monthLabels.isEmpty()) |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 ASSERT(symbols.size() == DecimalSymbolsSize); | 323 ASSERT(symbols.size() == DecimalSymbolsSize); |
324 | 324 |
325 String positivePrefix([formatter.get() positivePrefix]); | 325 String positivePrefix([formatter.get() positivePrefix]); |
326 String positiveSuffix([formatter.get() positiveSuffix]); | 326 String positiveSuffix([formatter.get() positiveSuffix]); |
327 String negativePrefix([formatter.get() negativePrefix]); | 327 String negativePrefix([formatter.get() negativePrefix]); |
328 String negativeSuffix([formatter.get() negativeSuffix]); | 328 String negativeSuffix([formatter.get() negativeSuffix]); |
329 setLocaleData(symbols, positivePrefix, positiveSuffix, negativePrefix, | 329 setLocaleData(symbols, positivePrefix, positiveSuffix, negativePrefix, |
330 negativeSuffix); | 330 negativeSuffix); |
331 } | 331 } |
332 } | 332 } |
OLD | NEW |