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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ui/select_file_dialog.h" | 17 #include "chrome/browser/ui/select_file_dialog.h" |
18 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 18 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
19 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
21 #include "content/browser/gpu/gpu_data_manager.h" | 21 #include "content/browser/gpu/gpu_data_manager.h" |
22 #include "content/browser/renderer_host/render_view_host.h" | 22 #include "content/browser/renderer_host/render_view_host.h" |
23 #include "content/browser/tab_contents/tab_contents_view.h" | 23 #include "content/browser/tab_contents/tab_contents_view.h" |
24 #include "content/browser/trace_controller.h" | 24 #include "content/browser/trace_controller.h" |
| 25 #include "content/browser/webui/web_ui.h" |
25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
27 #include "content/public/browser/web_ui_message_handler.h" | 28 #include "content/public/browser/web_ui_message_handler.h" |
28 #include "grit/browser_resources.h" | 29 #include "grit/browser_resources.h" |
29 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
30 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
31 | 32 |
32 using content::BrowserThread; | 33 using content::BrowserThread; |
33 using content::WebContents; | 34 using content::WebContents; |
34 using content::WebUIMessageHandler; | 35 using content::WebUIMessageHandler; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 405 |
405 } // namespace | 406 } // namespace |
406 | 407 |
407 | 408 |
408 //////////////////////////////////////////////////////////////////////////////// | 409 //////////////////////////////////////////////////////////////////////////////// |
409 // | 410 // |
410 // TracingUI | 411 // TracingUI |
411 // | 412 // |
412 //////////////////////////////////////////////////////////////////////////////// | 413 //////////////////////////////////////////////////////////////////////////////// |
413 | 414 |
414 TracingUI::TracingUI(WebContents* contents) : WebUI(contents, this) { | 415 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { |
415 AddMessageHandler(new TracingMessageHandler()); | 416 web_ui->AddMessageHandler(new TracingMessageHandler()); |
416 | 417 |
417 // Set up the chrome://tracing/ source. | 418 // Set up the chrome://tracing/ source. |
418 Profile::FromBrowserContext(contents->GetBrowserContext())-> | 419 Profile::FromBrowserContext(web_ui->web_contents()->GetBrowserContext())-> |
419 GetChromeURLDataManager()->AddDataSource(CreateTracingHTMLSource()); | 420 GetChromeURLDataManager()->AddDataSource(CreateTracingHTMLSource()); |
420 } | 421 } |
OLD | NEW |