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 "content/browser/tracing/tracing_ui.h" | 5 #include "content/browser/tracing/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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
35 #include "chromeos/dbus/dbus_thread_manager.h" | 35 #include "chromeos/dbus/dbus_thread_manager.h" |
36 #include "chromeos/dbus/debug_daemon_client.h" | 36 #include "chromeos/dbus/debug_daemon_client.h" |
37 #endif | 37 #endif |
38 | 38 |
39 namespace content { | 39 namespace content { |
40 namespace { | 40 namespace { |
41 | 41 |
42 WebUIDataSource* CreateTracingHTMLSource() { | 42 WebUIDataSource* CreateTracingHTMLSource() { |
43 WebUIDataSource* source = | 43 WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost); |
44 WebUIDataSource::Create(chrome::kChromeUITracingHost); | |
45 | 44 |
46 source->SetJsonPath("strings.js"); | 45 source->SetJsonPath("strings.js"); |
47 source->SetDefaultResource(IDR_TRACING_HTML); | 46 source->SetDefaultResource(IDR_TRACING_HTML); |
48 source->AddResourcePath("tracing.js", IDR_TRACING_JS); | 47 source->AddResourcePath("tracing.js", IDR_TRACING_JS); |
49 return source; | 48 return source; |
50 } | 49 } |
51 | 50 |
52 // This class receives javascript messages from the renderer. | 51 // This class receives javascript messages from the renderer. |
53 // Note that the WebUI infrastructure runs on the UI thread, therefore all of | 52 // Note that the WebUI infrastructure runs on the UI thread, therefore all of |
54 // this class's methods are expected to run on the UI thread. | 53 // this class's methods are expected to run on the UI thread. |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { | 529 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { |
531 web_ui->AddMessageHandler(new TracingMessageHandler()); | 530 web_ui->AddMessageHandler(new TracingMessageHandler()); |
532 | 531 |
533 // Set up the chrome://tracing/ source. | 532 // Set up the chrome://tracing/ source. |
534 BrowserContext* browser_context = | 533 BrowserContext* browser_context = |
535 web_ui->GetWebContents()->GetBrowserContext(); | 534 web_ui->GetWebContents()->GetBrowserContext(); |
536 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); | 535 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); |
537 } | 536 } |
538 | 537 |
539 } // namespace content | 538 } // namespace content |
OLD | NEW |