OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/net_export_ui.h" | 5 #include "chrome/browser/ui/webui/net_export_ui.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 chrome::android::SendEmail( | 237 chrome::android::SendEmail( |
238 base::UTF8ToUTF16(email), base::UTF8ToUTF16(subject), | 238 base::UTF8ToUTF16(email), base::UTF8ToUTF16(subject), |
239 base::UTF8ToUTF16(body), base::UTF8ToUTF16(title), | 239 base::UTF8ToUTF16(body), base::UTF8ToUTF16(title), |
240 base::UTF8ToUTF16(file_to_attach)); | 240 base::UTF8ToUTF16(file_to_attach)); |
241 #endif | 241 #endif |
242 } | 242 } |
243 | 243 |
244 void NetExportMessageHandler::OnExportNetLogInfoChanged(base::Value* arg) { | 244 void NetExportMessageHandler::OnExportNetLogInfoChanged(base::Value* arg) { |
245 std::unique_ptr<base::Value> value(arg); | 245 std::unique_ptr<base::Value> value(arg); |
246 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 246 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
247 web_ui()->CallJavascriptFunction(net_log::kOnExportNetLogInfoChanged, *arg); | 247 web_ui()->CallJavascriptFunctionUnsafe(net_log::kOnExportNetLogInfoChanged, |
| 248 *arg); |
248 } | 249 } |
249 | 250 |
250 } // namespace | 251 } // namespace |
251 | 252 |
252 NetExportUI::NetExportUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 253 NetExportUI::NetExportUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
253 web_ui->AddMessageHandler(new NetExportMessageHandler()); | 254 web_ui->AddMessageHandler(new NetExportMessageHandler()); |
254 | 255 |
255 // Set up the chrome://net-export/ source. | 256 // Set up the chrome://net-export/ source. |
256 Profile* profile = Profile::FromWebUI(web_ui); | 257 Profile* profile = Profile::FromWebUI(web_ui); |
257 content::WebUIDataSource::Add(profile, CreateNetExportHTMLSource()); | 258 content::WebUIDataSource::Add(profile, CreateNetExportHTMLSource()); |
258 } | 259 } |
OLD | NEW |