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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/media/webrtc_log_list.h" | 18 #include "chrome/browser/media/webrtc_log_list.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/upload_list.h" | 20 #include "chrome/browser/upload_list.h" |
21 #include "chrome/common/chrome_version_info.h" | |
22 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
23 #include "chrome/grit/generated_resources.h" | 22 #include "chrome/grit/generated_resources.h" |
| 23 #include "components/version_info/version_info.h" |
24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
25 #include "content/public/browser/web_ui.h" | 25 #include "content/public/browser/web_ui.h" |
26 #include "content/public/browser/web_ui_data_source.h" | 26 #include "content/public/browser/web_ui_data_source.h" |
27 #include "content/public/browser/web_ui_message_handler.h" | 27 #include "content/public/browser/web_ui_message_handler.h" |
28 #include "grit/browser_resources.h" | 28 #include "grit/browser_resources.h" |
29 | 29 |
30 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
31 #include "chrome/browser/chromeos/settings/cros_settings.h" | 31 #include "chrome/browser/chromeos/settings/cros_settings.h" |
32 #endif | 32 #endif |
33 | 33 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 base::FilePath::StringType value; | 169 base::FilePath::StringType value; |
170 if (!i->local_id.empty()) | 170 if (!i->local_id.empty()) |
171 value = log_dir_.AppendASCII(i->local_id) | 171 value = log_dir_.AppendASCII(i->local_id) |
172 .AddExtension(FILE_PATH_LITERAL(".gz")).value(); | 172 .AddExtension(FILE_PATH_LITERAL(".gz")).value(); |
173 upload->SetString("local_file", value); | 173 upload->SetString("local_file", value); |
174 | 174 |
175 upload_list.Append(upload); | 175 upload_list.Append(upload); |
176 } | 176 } |
177 | 177 |
178 const chrome::VersionInfo version_info; | 178 base::StringValue version(version_info::GetVersionNumber()); |
179 base::StringValue version(version_info.Version()); | |
180 | 179 |
181 web_ui()->CallJavascriptFunction("updateWebRtcLogsList", upload_list, | 180 web_ui()->CallJavascriptFunction("updateWebRtcLogsList", upload_list, |
182 version); | 181 version); |
183 } | 182 } |
184 | 183 |
185 } // namespace | 184 } // namespace |
186 | 185 |
187 /////////////////////////////////////////////////////////////////////////////// | 186 /////////////////////////////////////////////////////////////////////////////// |
188 // | 187 // |
189 // WebRtcLogsUI | 188 // WebRtcLogsUI |
190 // | 189 // |
191 /////////////////////////////////////////////////////////////////////////////// | 190 /////////////////////////////////////////////////////////////////////////////// |
192 | 191 |
193 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 192 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
194 Profile* profile = Profile::FromWebUI(web_ui); | 193 Profile* profile = Profile::FromWebUI(web_ui); |
195 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); | 194 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); |
196 | 195 |
197 // Set up the chrome://webrtc-logs/ source. | 196 // Set up the chrome://webrtc-logs/ source. |
198 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); | 197 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); |
199 } | 198 } |
OLD | NEW |