| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/chromeos/slow_trace_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/slow_trace_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 SlowTraceSource::~SlowTraceSource() {} | 57 SlowTraceSource::~SlowTraceSource() {} |
| 58 | 58 |
| 59 void SlowTraceSource::OnGetTraceData( | 59 void SlowTraceSource::OnGetTraceData( |
| 60 const content::URLDataSource::GotDataCallback& callback, | 60 const content::URLDataSource::GotDataCallback& callback, |
| 61 scoped_refptr<base::RefCountedString> trace_data) { | 61 scoped_refptr<base::RefCountedString> trace_data) { |
| 62 callback.Run(trace_data.get()); | 62 callback.Run(trace_data.get()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool SlowTraceSource::AllowCaching() const { |
| 66 // Should not be cached to reflect dynamically-generated contents that may |
| 67 // depend on current settings. |
| 68 return false; |
| 69 } |
| 70 |
| 65 //////////////////////////////////////////////////////////////////////////////// | 71 //////////////////////////////////////////////////////////////////////////////// |
| 66 // | 72 // |
| 67 // SlowTraceController | 73 // SlowTraceController |
| 68 // | 74 // |
| 69 //////////////////////////////////////////////////////////////////////////////// | 75 //////////////////////////////////////////////////////////////////////////////// |
| 70 | 76 |
| 71 SlowTraceController::SlowTraceController(content::WebUI* web_ui) | 77 SlowTraceController::SlowTraceController(content::WebUI* web_ui) |
| 72 : WebUIController(web_ui) { | 78 : WebUIController(web_ui) { |
| 73 SlowTraceSource* html_source = new SlowTraceSource(); | 79 SlowTraceSource* html_source = new SlowTraceSource(); |
| 74 | 80 |
| 75 // Set up the chrome://slow_trace/ source. | 81 // Set up the chrome://slow_trace/ source. |
| 76 Profile* profile = Profile::FromWebUI(web_ui); | 82 Profile* profile = Profile::FromWebUI(web_ui); |
| 77 content::URLDataSource::Add(profile, html_source); | 83 content::URLDataSource::Add(profile, html_source); |
| 78 } | 84 } |
| 79 | 85 |
| 80 } // namespace chromeos | 86 } // namespace chromeos |
| OLD | NEW |