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/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 // Set up the chrome://tracing/ source. | 236 // Set up the chrome://tracing/ source. |
237 BrowserContext* browser_context = | 237 BrowserContext* browser_context = |
238 web_ui->GetWebContents()->GetBrowserContext(); | 238 web_ui->GetWebContents()->GetBrowserContext(); |
239 | 239 |
240 WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost); | 240 WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost); |
241 source->SetJsonPath("strings.js"); | 241 source->SetJsonPath("strings.js"); |
242 source->SetDefaultResource(IDR_TRACING_HTML); | 242 source->SetDefaultResource(IDR_TRACING_HTML); |
243 source->AddResourcePath("tracing.js", IDR_TRACING_JS); | 243 source->AddResourcePath("tracing.js", IDR_TRACING_JS); |
244 source->SetRequestFilter(base::Bind(OnTracingRequest)); | 244 source->SetRequestFilter(base::Bind(OnTracingRequest)); |
245 WebUIDataSource::Add(browser_context, source); | 245 WebUIDataSource::Add(browser_context, source); |
246 TracingController::GetInstance()->RegisterTracingUI(this); | |
247 } | |
248 | |
249 TracingUI::~TracingUI() | |
250 { | |
dsinclair
2014/01/08 15:57:27
nit: move to line above.
| |
251 TracingController::GetInstance()->UnregisterTracingUI(this); | |
252 } | |
253 | |
254 void TracingUI::OnMonitoringStateChanged(bool is_monitoring) | |
255 { | |
dsinclair
2014/01/08 15:57:27
nit: ditto
| |
256 web_ui()->CallJavascriptFunction( | |
257 "onMonitoringStateChanged", base::FundamentalValue(is_monitoring)); | |
246 } | 258 } |
247 | 259 |
248 } // namespace content | 260 } // namespace content |
OLD | NEW |