| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/browser/devtools/devtools_protocol.h" | 9 #include "content/browser/devtools/devtools_protocol.h" |
| 10 #include "content/browser/power_profiler/power_profiler_observer.h" | 10 #include "content/browser/power_profiler/power_profiler_observer.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 // This class provides power information to DevTools. | 14 // This class provides power information to DevTools. |
| 15 class DevToolsPowerHandler | 15 class DevToolsPowerHandler |
| 16 : public DevToolsProtocol::Handler, | 16 : public DevToolsProtocol::Handler, |
| 17 public PowerProfilerObserver { | 17 public PowerProfilerObserver { |
| 18 public: | 18 public: |
| 19 DevToolsPowerHandler(); | 19 DevToolsPowerHandler(); |
| 20 virtual ~DevToolsPowerHandler(); | 20 virtual ~DevToolsPowerHandler(); |
| 21 | 21 |
| 22 // PowerProfilerObserver override. | 22 // PowerProfilerObserver override. |
| 23 virtual void OnPowerEvent(const PowerEventVector&) OVERRIDE; | 23 virtual void OnPowerEvent(const PowerEventVector&) override; |
| 24 | 24 |
| 25 void OnClientDetached(); | 25 void OnClientDetached(); |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 scoped_refptr<DevToolsProtocol::Response> OnStart( | 28 scoped_refptr<DevToolsProtocol::Response> OnStart( |
| 29 scoped_refptr<DevToolsProtocol::Command> command); | 29 scoped_refptr<DevToolsProtocol::Command> command); |
| 30 scoped_refptr<DevToolsProtocol::Response> OnEnd( | 30 scoped_refptr<DevToolsProtocol::Response> OnEnd( |
| 31 scoped_refptr<DevToolsProtocol::Command> command); | 31 scoped_refptr<DevToolsProtocol::Command> command); |
| 32 scoped_refptr<DevToolsProtocol::Response> OnCanProfilePower( | 32 scoped_refptr<DevToolsProtocol::Response> OnCanProfilePower( |
| 33 scoped_refptr<DevToolsProtocol::Command> command); | 33 scoped_refptr<DevToolsProtocol::Command> command); |
| 34 scoped_refptr<DevToolsProtocol::Response> OnGetAccuracyLevel( | 34 scoped_refptr<DevToolsProtocol::Response> OnGetAccuracyLevel( |
| 35 scoped_refptr<DevToolsProtocol::Command> command); | 35 scoped_refptr<DevToolsProtocol::Command> command); |
| 36 bool is_profiling_; | 36 bool is_profiling_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(DevToolsPowerHandler); | 38 DISALLOW_COPY_AND_ASSIGN(DevToolsPowerHandler); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace content | 41 } // namespace content |
| 42 | 42 |
| 43 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ | 43 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ |
| OLD | NEW |