Index: chrome/browser/devtools/devtools_window.cc |
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc |
index 254a004eaa9bb907df78ee1d1b8df63ff80e53df..ba0c6c0cc732fad1d48b1c3a1676398fc908edd8 100644 |
--- a/chrome/browser/devtools/devtools_window.cc |
+++ b/chrome/browser/devtools/devtools_window.cc |
@@ -55,6 +55,7 @@ |
#include "content/public/browser/navigation_controller.h" |
#include "content/public/browser/navigation_entry.h" |
#include "content/public/browser/notification_source.h" |
+#include "content/public/browser/power_profiler_service.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/user_metrics.h" |
@@ -684,7 +685,8 @@ DevToolsWindow::DevToolsWindow(Profile* profile, |
file_helper_.reset(new DevToolsFileHelper(web_contents_, profile)); |
file_system_indexer_ = new DevToolsFileSystemIndexer(); |
extensions::ExtensionWebContentsObserver::CreateForWebContents(web_contents_); |
- |
+ power_profiler_host_ = new DevToolsPowerProfilerHost( |
+ weak_factory_.GetWeakPtr()); |
g_instances.Get().push_back(this); |
// Wipe out page icon so that the default application icon is used. |
@@ -1234,6 +1236,29 @@ void DevToolsWindow::SearchInPath(int request_id, |
file_system_path)); |
} |
+void DevToolsWindow::QueryPowerProfilerServiceStatus() { |
+ bool is_supported = true; |
+ if (!content::PowerProfilerService::GetInstance()->IsAvailable()) |
+ is_supported = false; |
+ // To tell front-end, not implemented yet |
+} |
+ |
+void DevToolsWindow::StartPowerProfiling() { |
+ power_profiler_host_->Register(); |
+} |
+ |
+void DevToolsWindow::StopPowerProfiling() { |
+ power_profiler_host_->Unregister(); |
+} |
+ |
+void DevToolsWindow::SetPowerProfilingResolution(unsigned resolution) { |
+ DCHECK(resolution >= 0 && |
+ resolution < static_cast<unsigned>( |
+ content::PowerProfilerObserver::TYPE_COUNT)); |
+ power_profiler_host_->SetResolution( |
+ static_cast<content::PowerProfilerObserver::Resolution>(resolution)); |
+} |
+ |
void DevToolsWindow::FileSavedAs(const std::string& url) { |
StringValue url_value(url); |
CallClientFunction("InspectorFrontendAPI.savedURL", &url_value, NULL, NULL); |
@@ -1331,6 +1356,10 @@ void DevToolsWindow::ShowDevToolsConfirmInfoBar( |
callback, message); |
} |
+void DevToolsWindow::SendPowerEvent(const std::string& message) { |
+ // To tell front-end, not implemented yet |
+} |
+ |
void DevToolsWindow::CreateDevToolsBrowser() { |
std::string wp_key = GetDevToolsWindowPlacementPrefKey(); |
PrefService* prefs = profile_->GetPrefs(); |