| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 22 #include "content/browser/gpu/gpu_data_manager.h" | 22 #include "content/browser/gpu/gpu_data_manager.h" |
| 23 #include "content/browser/renderer_host/render_view_host.h" | 23 #include "content/browser/renderer_host/render_view_host.h" |
| 24 #include "content/browser/tab_contents/tab_contents.h" | 24 #include "content/browser/tab_contents/tab_contents.h" |
| 25 #include "content/browser/tab_contents/tab_contents_view.h" | 25 #include "content/browser/tab_contents/tab_contents_view.h" |
| 26 #include "content/browser/trace_controller.h" | 26 #include "content/browser/trace_controller.h" |
| 27 #include "grit/browser_resources.h" | 27 #include "grit/browser_resources.h" |
| 28 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 30 | 30 |
| 31 using content::BrowserThread; |
| 32 |
| 31 namespace { | 33 namespace { |
| 32 | 34 |
| 33 ChromeWebUIDataSource* CreateTracingHTMLSource() { | 35 ChromeWebUIDataSource* CreateTracingHTMLSource() { |
| 34 ChromeWebUIDataSource* source = | 36 ChromeWebUIDataSource* source = |
| 35 new ChromeWebUIDataSource(chrome::kChromeUITracingHost); | 37 new ChromeWebUIDataSource(chrome::kChromeUITracingHost); |
| 36 | 38 |
| 37 source->set_json_path("strings.js"); | 39 source->set_json_path("strings.js"); |
| 38 source->add_resource_path("tracing.js", IDR_TRACING_JS); | 40 source->add_resource_path("tracing.js", IDR_TRACING_JS); |
| 39 source->set_default_resource(IDR_TRACING_HTML); | 41 source->set_default_resource(IDR_TRACING_HTML); |
| 40 source->AddLocalizedString("tracingTitle", IDS_TRACING_TITLE); | 42 source->AddLocalizedString("tracingTitle", IDS_TRACING_TITLE); |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // | 453 // |
| 452 //////////////////////////////////////////////////////////////////////////////// | 454 //////////////////////////////////////////////////////////////////////////////// |
| 453 | 455 |
| 454 TracingUI::TracingUI(TabContents* contents) : ChromeWebUI(contents) { | 456 TracingUI::TracingUI(TabContents* contents) : ChromeWebUI(contents) { |
| 455 AddMessageHandler((new TracingMessageHandler())->Attach(this)); | 457 AddMessageHandler((new TracingMessageHandler())->Attach(this)); |
| 456 | 458 |
| 457 // Set up the chrome://tracing/ source. | 459 // Set up the chrome://tracing/ source. |
| 458 Profile::FromBrowserContext(contents->browser_context())-> | 460 Profile::FromBrowserContext(contents->browser_context())-> |
| 459 GetChromeURLDataManager()->AddDataSource(CreateTracingHTMLSource()); | 461 GetChromeURLDataManager()->AddDataSource(CreateTracingHTMLSource()); |
| 460 } | 462 } |
| OLD | NEW |