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

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/timezone_options_util.cc

Issue 10857071: Options: Rename options2 namespace to options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/options2/chromeos/timezone_options_util.h" 5 #include "chrome/browser/ui/webui/options2/chromeos/timezone_options_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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 timezone.getDisplayName(dst_offset != 0, icu::TimeZone::LONG, name); 114 timezone.getDisplayName(dst_offset != 0, icu::TimeZone::LONG, name);
115 string16 result(l10n_util::GetStringFUTF16( 115 string16 result(l10n_util::GetStringFUTF16(
116 IDS_OPTIONS_SETTINGS_TIMEZONE_DISPLAY_TEMPLATE, ASCIIToUTF16(offset_str), 116 IDS_OPTIONS_SETTINGS_TIMEZONE_DISPLAY_TEMPLATE, ASCIIToUTF16(offset_str),
117 string16(name.getBuffer(), name.length()), GetExemplarCity(timezone))); 117 string16(name.getBuffer(), name.length()), GetExemplarCity(timezone)));
118 base::i18n::AdjustStringForLocaleDirection(&result); 118 base::i18n::AdjustStringForLocaleDirection(&result);
119 return result; 119 return result;
120 } 120 }
121 121
122 } // namespace 122 } // namespace
123 123
124 namespace options2 { 124 namespace options {
125 125
126 // Creates a list of pairs of each timezone's ID and name. 126 // Creates a list of pairs of each timezone's ID and name.
127 scoped_ptr<base::ListValue> GetTimezoneList() { 127 scoped_ptr<base::ListValue> GetTimezoneList() {
128 const std::vector<icu::TimeZone*> &timezones = 128 const std::vector<icu::TimeZone*> &timezones =
129 chromeos::system::TimezoneSettings::GetInstance()->GetTimezoneList(); 129 chromeos::system::TimezoneSettings::GetInstance()->GetTimezoneList();
130 scoped_ptr<base::ListValue> timezoneList(new base::ListValue()); 130 scoped_ptr<base::ListValue> timezoneList(new base::ListValue());
131 for (std::vector<icu::TimeZone*>::const_iterator iter = timezones.begin(); 131 for (std::vector<icu::TimeZone*>::const_iterator iter = timezones.begin();
132 iter != timezones.end(); ++iter) { 132 iter != timezones.end(); ++iter) {
133 const icu::TimeZone* timezone = *iter; 133 const icu::TimeZone* timezone = *iter;
134 base::ListValue* option = new base::ListValue(); 134 base::ListValue* option = new base::ListValue();
135 option->Append(Value::CreateStringValue( 135 option->Append(Value::CreateStringValue(
136 chromeos::system::TimezoneSettings::GetTimezoneID(*timezone))); 136 chromeos::system::TimezoneSettings::GetTimezoneID(*timezone)));
137 option->Append(Value::CreateStringValue(GetTimezoneName(*timezone))); 137 option->Append(Value::CreateStringValue(GetTimezoneName(*timezone)));
138 timezoneList->Append(option); 138 timezoneList->Append(option);
139 } 139 }
140 return timezoneList.Pass(); 140 return timezoneList.Pass();
141 } 141 }
142 142
143 } // namespace options2 143 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698