Index: content/public/browser/power_profiler_observer.h |
diff --git a/content/public/browser/power_profiler_observer.h b/content/public/browser/power_profiler_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..881a321350e12d40269394ed05654e22be5b1e7f |
--- /dev/null |
+++ b/content/public/browser/power_profiler_observer.h |
@@ -0,0 +1,41 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ |
+#define CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/ref_counted.h" |
+#include "content/common/content_export.h" |
+#include "content/public/browser/power_data_provider.h" |
+ |
+namespace content { |
+ |
+// A class used to monitor the power usage and tell profiler the power data |
+class CONTENT_EXPORT PowerProfilerObserver { |
+ public: |
+ enum Resolution { |
+ LOW, |
+ NORMAL, |
+ HIGH, |
+ TYPE_COUNT // this should be always the last one |
+ }; |
+ |
+ PowerProfilerObserver(); |
+ ~PowerProfilerObserver(); |
qsr
2014/01/23 12:50:06
Where is the implementation of those 2 methods? Yo
Pan
2014/01/25 09:35:53
Done.
|
+ |
+ // This method should be called on UI thread |
+ virtual void OnPowerEvent(const PowerEvent&) = 0; |
+ |
+ // This method compares resolution with derived class's requirements, |
+ // and over-write resolution with the higher one. |
+ virtual void GetHigherResolution(Resolution& resolution) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(PowerProfilerObserver); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ |