| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/i18n/timezone.h" | 5 #include "base/i18n/timezone.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 7 #include <string.h> | 8 #include <string.h> |
| 8 | 9 |
| 9 #include <map> | 10 #include <map> |
| 10 | 11 |
| 12 #include "base/macros.h" |
| 11 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 12 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 14 #include "third_party/icu/source/i18n/unicode/timezone.h" | 16 #include "third_party/icu/source/i18n/unicode/timezone.h" |
| 15 | 17 |
| 16 namespace base { | 18 namespace base { |
| 17 | 19 |
| 18 namespace { | 20 namespace { |
| 19 | 21 |
| 20 class TimezoneMap { | 22 class TimezoneMap { |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 std::string CountryCodeForCurrentTimezone() { | 609 std::string CountryCodeForCurrentTimezone() { |
| 608 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 610 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
| 609 icu::UnicodeString id; | 611 icu::UnicodeString id; |
| 610 zone->getID(id); | 612 zone->getID(id); |
| 611 string16 olson_code(id.getBuffer(), id.length()); | 613 string16 olson_code(id.getBuffer(), id.length()); |
| 612 return TimezoneMap::GetInstance()->CountryCodeForTimezone( | 614 return TimezoneMap::GetInstance()->CountryCodeForTimezone( |
| 613 UTF16ToUTF8(olson_code)); | 615 UTF16ToUTF8(olson_code)); |
| 614 } | 616 } |
| 615 | 617 |
| 616 } // namespace base | 618 } // namespace base |
| OLD | NEW |