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

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

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble Created 3 years, 8 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/power_ui.cc ('k') | chrome/browser/ui/webui/components_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, &current_timezone_id); 127 CrosSettings::Get()->GetString(kSystemTimezone, &current_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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/power_ui.cc ('k') | chrome/browser/ui/webui/components_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698