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" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // | 71 // |
72 // WebRtcLogsDOMHandler | 72 // WebRtcLogsDOMHandler |
73 // | 73 // |
74 //////////////////////////////////////////////////////////////////////////////// | 74 //////////////////////////////////////////////////////////////////////////////// |
75 | 75 |
76 // The handler for Javascript messages for the chrome://webrtc-logs/ page. | 76 // The handler for Javascript messages for the chrome://webrtc-logs/ page. |
77 class WebRtcLogsDOMHandler : public WebUIMessageHandler, | 77 class WebRtcLogsDOMHandler : public WebUIMessageHandler, |
78 public UploadList::Delegate { | 78 public UploadList::Delegate { |
79 public: | 79 public: |
80 explicit WebRtcLogsDOMHandler(Profile* profile); | 80 explicit WebRtcLogsDOMHandler(Profile* profile); |
81 virtual ~WebRtcLogsDOMHandler(); | 81 ~WebRtcLogsDOMHandler() override; |
82 | 82 |
83 // WebUIMessageHandler implementation. | 83 // WebUIMessageHandler implementation. |
84 virtual void RegisterMessages() override; | 84 void RegisterMessages() override; |
85 | 85 |
86 // UploadList::Delegate implemenation. | 86 // UploadList::Delegate implemenation. |
87 virtual void OnUploadListAvailable() override; | 87 void OnUploadListAvailable() override; |
88 | 88 |
89 private: | 89 private: |
90 // Asynchronously fetches the list of upload WebRTC logs. Called from JS. | 90 // Asynchronously fetches the list of upload WebRTC logs. Called from JS. |
91 void HandleRequestWebRtcLogs(const base::ListValue* args); | 91 void HandleRequestWebRtcLogs(const base::ListValue* args); |
92 | 92 |
93 // Sends the recently uploaded logs list JS. | 93 // Sends the recently uploaded logs list JS. |
94 void UpdateUI(); | 94 void UpdateUI(); |
95 | 95 |
96 // Loads, parses and stores the list of uploaded WebRTC logs. | 96 // Loads, parses and stores the list of uploaded WebRTC logs. |
97 scoped_refptr<UploadList> upload_list_; | 97 scoped_refptr<UploadList> upload_list_; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // | 191 // |
192 /////////////////////////////////////////////////////////////////////////////// | 192 /////////////////////////////////////////////////////////////////////////////// |
193 | 193 |
194 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 194 WebRtcLogsUI::WebRtcLogsUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
195 Profile* profile = Profile::FromWebUI(web_ui); | 195 Profile* profile = Profile::FromWebUI(web_ui); |
196 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); | 196 web_ui->AddMessageHandler(new WebRtcLogsDOMHandler(profile)); |
197 | 197 |
198 // Set up the chrome://webrtc-logs/ source. | 198 // Set up the chrome://webrtc-logs/ source. |
199 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); | 199 content::WebUIDataSource::Add(profile, CreateWebRtcLogsUIHTMLSource()); |
200 } | 200 } |
OLD | NEW |