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

Side by Side Diff: chrome/browser/chromeos/system/timezone_util.cc

Issue 168643002: Convert scoped_ptr_malloc -> scoped_ptr, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/chromeos/system/timezone_util.h" 5 #include "chrome/browser/chromeos/system/timezone_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 zone_strings = ures_getByKey(zone_bundle, "zone_strings", NULL, &status); 51 zone_strings = ures_getByKey(zone_bundle, "zone_strings", NULL, &status);
52 } 52 }
53 53
54 icu::UnicodeString zone_id; 54 icu::UnicodeString zone_id;
55 zone.getID(zone_id); 55 zone.getID(zone_id);
56 std::string zone_id_str; 56 std::string zone_id_str;
57 zone_id.toUTF8String(zone_id_str); 57 zone_id.toUTF8String(zone_id_str);
58 58
59 // Resource keys for timezones use ':' in place of '/'. 59 // Resource keys for timezones use ':' in place of '/'.
60 ReplaceSubstringsAfterOffset(&zone_id_str, 0, "/", ":"); 60 ReplaceSubstringsAfterOffset(&zone_id_str, 0, "/", ":");
61 scoped_ptr_malloc<UResourceBundle, UResClose> zone_item( 61 scoped_ptr<UResourceBundle, UResClose> zone_item(
62 ures_getByKey(zone_strings, zone_id_str.c_str(), NULL, &status)); 62 ures_getByKey(zone_strings, zone_id_str.c_str(), NULL, &status));
63 icu::UnicodeString city; 63 icu::UnicodeString city;
64 if (!U_FAILURE(status)) { 64 if (!U_FAILURE(status)) {
65 city = icu::ures_getUnicodeStringByKey(zone_item.get(), "ec", &status); 65 city = icu::ures_getUnicodeStringByKey(zone_item.get(), "ec", &status);
66 if (U_SUCCESS(status)) 66 if (U_SUCCESS(status))
67 return base::string16(city.getBuffer(), city.length()); 67 return base::string16(city.getBuffer(), city.length());
68 } 68 }
69 69
70 // Fallback case in case of failure. 70 // Fallback case in case of failure.
71 ReplaceSubstringsAfterOffset(&zone_id_str, 0, ":", "/"); 71 ReplaceSubstringsAfterOffset(&zone_id_str, 0, ":", "/");
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 option->Append(new base::StringValue( 138 option->Append(new base::StringValue(
139 chromeos::system::TimezoneSettings::GetTimezoneID(*timezone))); 139 chromeos::system::TimezoneSettings::GetTimezoneID(*timezone)));
140 option->Append(new base::StringValue(GetTimezoneName(*timezone))); 140 option->Append(new base::StringValue(GetTimezoneName(*timezone)));
141 timezoneList->Append(option); 141 timezoneList->Append(option);
142 } 142 }
143 return timezoneList.Pass(); 143 return timezoneList.Pass();
144 } 144 }
145 145
146 } // namespace system 146 } // namespace system
147 } // namespace chromeos 147 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/app/image_pre_reader_win.cc ('k') | chrome/browser/extensions/api/cast_channel/cast_auth_util_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698