OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017 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. |
| 4 |
| 5 #ifndef COMPONENTS_UKM_DEBUG_PAGE_REQUEST_JOB_H_ |
| 6 #define COMPONENTS_UKM_DEBUG_PAGE_REQUEST_JOB_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "content/public/browser/url_data_source.h" |
| 13 |
| 14 namespace ukm { |
| 15 |
| 16 class UkmService; |
| 17 |
| 18 namespace debug { |
| 19 |
| 20 // Implements the chrome://ukm page for debugging UKM state. |
| 21 class DebugPage : public content::URLDataSource { |
| 22 public: |
| 23 typedef base::Callback<UkmService*()> ServiceGetter; |
| 24 |
| 25 explicit DebugPage(ServiceGetter service_getter); |
| 26 |
| 27 // content::URLDataSource: |
| 28 std::string GetSource() const override; |
| 29 std::string GetMimeType(const std::string& path) const override; |
| 30 void StartDataRequest( |
| 31 const std::string& path, |
| 32 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
| 33 const content::URLDataSource::GotDataCallback& callback) override; |
| 34 bool AllowCaching() const override; |
| 35 |
| 36 private: |
| 37 ~DebugPage() override; |
| 38 |
| 39 ServiceGetter service_getter_; |
| 40 |
| 41 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugPage); |
| 42 }; |
| 43 |
| 44 } // namespace debug |
| 45 } // namespace ukm |
| 46 |
| 47 #endif // COMPONENTS_UKM_DEBUG_PAGE_REQUEST_JOB_H_ |
OLD | NEW |