| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tracing_ui.h" | 5 #include "chrome/browser/ui/webui/tracing_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 base::Bind(&ReadTraceFileCallback, | 340 base::Bind(&ReadTraceFileCallback, |
| 341 make_scoped_refptr(new TaskProxy(AsWeakPtr())), path)); | 341 make_scoped_refptr(new TaskProxy(AsWeakPtr())), path)); |
| 342 } else { | 342 } else { |
| 343 BrowserThread::PostTask( | 343 BrowserThread::PostTask( |
| 344 BrowserThread::FILE, FROM_HERE, | 344 BrowserThread::FILE, FROM_HERE, |
| 345 base::Bind(&WriteTraceFileCallback, | 345 base::Bind(&WriteTraceFileCallback, |
| 346 make_scoped_refptr(new TaskProxy(AsWeakPtr())), path, | 346 make_scoped_refptr(new TaskProxy(AsWeakPtr())), path, |
| 347 trace_data_to_save_.release())); | 347 trace_data_to_save_.release())); |
| 348 } | 348 } |
| 349 | 349 |
| 350 select_trace_file_dialog_.release(); | 350 select_trace_file_dialog_ = NULL; |
| 351 } | 351 } |
| 352 | 352 |
| 353 void TracingMessageHandler::FileSelectionCanceled(void* params) { | 353 void TracingMessageHandler::FileSelectionCanceled(void* params) { |
| 354 select_trace_file_dialog_.release(); | 354 select_trace_file_dialog_ = NULL; |
| 355 if (select_trace_file_dialog_type_ == | 355 if (select_trace_file_dialog_type_ == |
| 356 ui::SelectFileDialog::SELECT_OPEN_FILE) { | 356 ui::SelectFileDialog::SELECT_OPEN_FILE) { |
| 357 web_ui()->CallJavascriptFunction( | 357 web_ui()->CallJavascriptFunction( |
| 358 "tracingController.onLoadTraceFileCanceled"); | 358 "tracingController.onLoadTraceFileCanceled"); |
| 359 } else { | 359 } else { |
| 360 web_ui()->CallJavascriptFunction( | 360 web_ui()->CallJavascriptFunction( |
| 361 "tracingController.onSaveTraceFileCanceled"); | 361 "tracingController.onSaveTraceFileCanceled"); |
| 362 } | 362 } |
| 363 } | 363 } |
| 364 | 364 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 // | 542 // |
| 543 //////////////////////////////////////////////////////////////////////////////// | 543 //////////////////////////////////////////////////////////////////////////////// |
| 544 | 544 |
| 545 TracingUI::TracingUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 545 TracingUI::TracingUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 546 web_ui->AddMessageHandler(new TracingMessageHandler()); | 546 web_ui->AddMessageHandler(new TracingMessageHandler()); |
| 547 | 547 |
| 548 // Set up the chrome://tracing/ source. | 548 // Set up the chrome://tracing/ source. |
| 549 Profile* profile = Profile::FromWebUI(web_ui); | 549 Profile* profile = Profile::FromWebUI(web_ui); |
| 550 ChromeURLDataManager::AddDataSource(profile, CreateTracingHTMLSource()); | 550 ChromeURLDataManager::AddDataSource(profile, CreateTracingHTMLSource()); |
| 551 } | 551 } |
| OLD | NEW |