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 "chrome/browser/ui/webui/media/webrtc_logs_ui.h" | 5 #include "chrome/browser/ui/webui/media/webrtc_logs_ui.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 void WebRtcLogsDOMHandler::UpdateUI() { | 147 void WebRtcLogsDOMHandler::UpdateUI() { |
148 std::vector<UploadList::UploadInfo> uploads; | 148 std::vector<UploadList::UploadInfo> uploads; |
149 upload_list_->GetUploads(50, &uploads); | 149 upload_list_->GetUploads(50, &uploads); |
150 | 150 |
151 base::ListValue upload_list; | 151 base::ListValue upload_list; |
152 for (std::vector<UploadList::UploadInfo>::iterator i = uploads.begin(); | 152 for (std::vector<UploadList::UploadInfo>::iterator i = uploads.begin(); |
153 i != uploads.end(); | 153 i != uploads.end(); |
154 ++i) { | 154 ++i) { |
155 scoped_ptr<base::DictionaryValue> upload(new base::DictionaryValue()); | 155 std::unique_ptr<base::DictionaryValue> upload(new base::DictionaryValue()); |
156 upload->SetString("id", i->upload_id); | 156 upload->SetString("id", i->upload_id); |
157 | 157 |
158 base::string16 value_w; | 158 base::string16 value_w; |
159 if (!i->upload_time.is_null()) | 159 if (!i->upload_time.is_null()) |
160 value_w = base::TimeFormatFriendlyDateAndTime(i->upload_time); | 160 value_w = base::TimeFormatFriendlyDateAndTime(i->upload_time); |
161 upload->SetString("upload_time", value_w); | 161 upload->SetString("upload_time", value_w); |
162 | 162 |
163 base::FilePath::StringType value; | 163 base::FilePath::StringType value; |
164 if (!i->local_id.empty()) | 164 if (!i->local_id.empty()) |
165 value = log_dir_.AppendASCII(i->local_id) | 165 value = log_dir_.AppendASCII(i->local_id) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // | 212 // |
213 /////////////////////////////////////////////////////////////////////////////// | 213 /////////////////////////////////////////////////////////////////////////////// |
214 | 214 |
215 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 215 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
216 Profile* profile = Profile::FromWebUI(web_ui); | 216 Profile* profile = Profile::FromWebUI(web_ui); |
217 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); | 217 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); |
218 | 218 |
219 // Set up the chrome://webrtc-logs/ source. | 219 // Set up the chrome://webrtc-logs/ source. |
220 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); | 220 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); |
221 } | 221 } |
OLD | NEW |