OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/set_time_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/set_time_ui.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 source->AddLocalizedString("setTimeTitle", IDS_SET_TIME_TITLE); | 112 source->AddLocalizedString("setTimeTitle", IDS_SET_TIME_TITLE); |
113 source->AddLocalizedString("prompt", IDS_SET_TIME_PROMPT); | 113 source->AddLocalizedString("prompt", IDS_SET_TIME_PROMPT); |
114 source->AddLocalizedString("doneButton", IDS_SET_TIME_BUTTON_CLOSE); | 114 source->AddLocalizedString("doneButton", IDS_SET_TIME_BUTTON_CLOSE); |
115 source->AddLocalizedString("timezone", | 115 source->AddLocalizedString("timezone", |
116 IDS_OPTIONS_SETTINGS_TIMEZONE_DESCRIPTION); | 116 IDS_OPTIONS_SETTINGS_TIMEZONE_DESCRIPTION); |
117 source->AddLocalizedString("dateLabel", IDS_SET_TIME_DATE_LABEL); | 117 source->AddLocalizedString("dateLabel", IDS_SET_TIME_DATE_LABEL); |
118 source->AddLocalizedString("timeLabel", IDS_SET_TIME_TIME_LABEL); | 118 source->AddLocalizedString("timeLabel", IDS_SET_TIME_TIME_LABEL); |
119 | 119 |
120 base::DictionaryValue values; | 120 base::DictionaryValue values; |
121 values.Set("timezoneList", chromeos::system::GetTimezoneList().release()); | 121 values.Set("timezoneList", chromeos::system::GetTimezoneList()); |
122 | 122 |
123 // If we are not logged in, we need to show the time zone dropdown. | 123 // If we are not logged in, we need to show the time zone dropdown. |
124 // Otherwise, we can leave |currentTimezoneId| blank. | 124 // Otherwise, we can leave |currentTimezoneId| blank. |
125 std::string current_timezone_id; | 125 std::string current_timezone_id; |
126 if (!LoginState::Get()->IsUserLoggedIn()) | 126 if (!LoginState::Get()->IsUserLoggedIn()) |
127 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); | 127 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); |
128 values.SetString("currentTimezoneId", current_timezone_id); | 128 values.SetString("currentTimezoneId", current_timezone_id); |
129 values.SetDouble("buildTime", base::GetBuildTime().ToJsTime()); | 129 values.SetDouble("buildTime", base::GetBuildTime().ToJsTime()); |
130 | 130 |
131 source->AddLocalizedStrings(values); | 131 source->AddLocalizedStrings(values); |
132 source->SetJsonPath("strings.js"); | 132 source->SetJsonPath("strings.js"); |
133 | 133 |
134 source->AddResourcePath("set_time.css", IDR_SET_TIME_CSS); | 134 source->AddResourcePath("set_time.css", IDR_SET_TIME_CSS); |
135 source->AddResourcePath("set_time.js", IDR_SET_TIME_JS); | 135 source->AddResourcePath("set_time.js", IDR_SET_TIME_JS); |
136 source->SetDefaultResource(IDR_SET_TIME_HTML); | 136 source->SetDefaultResource(IDR_SET_TIME_HTML); |
137 | 137 |
138 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source); | 138 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source); |
139 } | 139 } |
140 | 140 |
141 SetTimeUI::~SetTimeUI() { | 141 SetTimeUI::~SetTimeUI() { |
142 } | 142 } |
143 | 143 |
144 } // namespace chromeos | 144 } // namespace chromeos |
OLD | NEW |