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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 class TracingMessageHandler | 55 class TracingMessageHandler |
56 : public WebUIMessageHandler, | 56 : public WebUIMessageHandler, |
57 public ui::SelectFileDialog::Listener, | 57 public ui::SelectFileDialog::Listener, |
58 public base::SupportsWeakPtr<TracingMessageHandler>, | 58 public base::SupportsWeakPtr<TracingMessageHandler>, |
59 public TraceSubscriber { | 59 public TraceSubscriber { |
60 public: | 60 public: |
61 TracingMessageHandler(); | 61 TracingMessageHandler(); |
62 virtual ~TracingMessageHandler(); | 62 virtual ~TracingMessageHandler(); |
63 | 63 |
64 // WebUIMessageHandler implementation. | 64 // WebUIMessageHandler implementation. |
65 virtual void RegisterMessages(); | 65 virtual void RegisterMessages() OVERRIDE; |
66 | 66 |
67 // SelectFileDialog::Listener implementation | 67 // SelectFileDialog::Listener implementation |
68 virtual void FileSelected(const base::FilePath& path, | 68 virtual void FileSelected(const base::FilePath& path, |
69 int index, | 69 int index, |
70 void* params); | 70 void* params) OVERRIDE; |
71 virtual void FileSelectionCanceled(void* params); | 71 virtual void FileSelectionCanceled(void* params) OVERRIDE; |
72 | 72 |
73 // TraceSubscriber implementation. | 73 // TraceSubscriber implementation. |
74 virtual void OnEndTracingComplete(); | 74 virtual void OnEndTracingComplete() OVERRIDE; |
75 virtual void OnTraceDataCollected( | 75 virtual void OnTraceDataCollected( |
76 const scoped_refptr<base::RefCountedString>& trace_fragment); | 76 const scoped_refptr<base::RefCountedString>& trace_fragment) OVERRIDE; |
77 virtual void OnTraceBufferPercentFullReply(float percent_full); | 77 virtual void OnTraceBufferPercentFullReply(float percent_full) OVERRIDE; |
78 | 78 |
79 // Messages. | 79 // Messages. |
80 void OnTracingControllerInitialized(const ListValue* list); | 80 void OnTracingControllerInitialized(const ListValue* list); |
81 void OnBeginTracing(const ListValue* list); | 81 void OnBeginTracing(const ListValue* list); |
82 void OnEndTracingAsync(const ListValue* list); | 82 void OnEndTracingAsync(const ListValue* list); |
83 void OnBeginRequestBufferPercentFull(const ListValue* list); | 83 void OnBeginRequestBufferPercentFull(const ListValue* list); |
84 void OnLoadTraceFile(const ListValue* list); | 84 void OnLoadTraceFile(const ListValue* list); |
85 void OnSaveTraceFile(const ListValue* list); | 85 void OnSaveTraceFile(const ListValue* list); |
86 | 86 |
87 // Callbacks. | 87 // Callbacks. |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { | 484 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { |
485 web_ui->AddMessageHandler(new TracingMessageHandler()); | 485 web_ui->AddMessageHandler(new TracingMessageHandler()); |
486 | 486 |
487 // Set up the chrome://tracing/ source. | 487 // Set up the chrome://tracing/ source. |
488 BrowserContext* browser_context = | 488 BrowserContext* browser_context = |
489 web_ui->GetWebContents()->GetBrowserContext(); | 489 web_ui->GetWebContents()->GetBrowserContext(); |
490 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); | 490 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); |
491 } | 491 } |
492 | 492 |
493 } // namespace content | 493 } // namespace content |
OLD | NEW |