1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_SLOW_TRACE_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_SLOW_TRACE_UI_H_
10 #include "base/compiler_specific.h"
11 #include "content/public/browser/url_data_source.h"
12 #include "content/public/browser/web_ui_controller.h"
13 #include "ui/base/layout.h"
16 class RefCountedMemory
;
17 class RefCountedString
;
22 // This class provides the source for chrome://slow_trace/. It needs to be a
23 // separate handler that chrome://slow, because URLDataSource and
24 // WebUIDataSource are not descended from each other, and WebUIDataSource
25 // doesn't allow the MimeType to be dynamically specified.
26 class SlowTraceSource
: public content::URLDataSource
{
30 // content::URLDataSource implementation.
31 std::string
GetSource() const override
;
32 void StartDataRequest(
33 const std::string
& path
,
34 int render_process_id
,
36 const content::URLDataSource::GotDataCallback
& callback
) override
;
37 std::string
GetMimeType(const std::string
& path
) const override
;
40 ~SlowTraceSource() override
;
42 void OnGetTraceData(const content::URLDataSource::GotDataCallback
& callback
,
43 scoped_refptr
<base::RefCountedString
> trace_data
);
45 DISALLOW_COPY_AND_ASSIGN(SlowTraceSource
);
48 class SlowTraceController
: public content::WebUIController
{
50 explicit SlowTraceController(content::WebUI
* web_ui
);
53 DISALLOW_COPY_AND_ASSIGN(SlowTraceController
);
56 } // namespace chromeos
58 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_SLOW_TRACE_UI_H_