Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / browser / power_profiler / power_profiler_service.cc
index 026b42a..84ddb1b 100644 (file)
@@ -42,10 +42,23 @@ PowerProfilerService::PowerProfilerService(
 PowerProfilerService::~PowerProfilerService() {
 }
 
-bool PowerProfilerService::IsAvailable() {
+bool PowerProfilerService::IsAvailable() const {
   return status_ !=  UNINITIALIZED;
 }
 
+std::string PowerProfilerService::GetAccuracyLevel() const {
+  DCHECK(IsAvailable());
+  switch (data_provider_->GetAccuracyLevel()) {
+    case PowerDataProvider::High:
+      return "High";
+    case PowerDataProvider::Moderate:
+      return "Moderate";
+    case PowerDataProvider::Low:
+      return "Low";
+  }
+  return "";
+}
+
 PowerProfilerService* PowerProfilerService::GetInstance() {
   return Singleton<PowerProfilerService>::get();
 }