Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / copresence / copresence_translations.cc
index 5fecde2..d00df3f 100644 (file)
@@ -9,7 +9,7 @@
 #include "components/copresence/proto/enums.pb.h"
 #include "components/copresence/proto/rpcs.pb.h"
 
-using copresence::AUDIBLE;
+using copresence::AUDIO_CONFIGURATION_AUDIBLE;
 using copresence::AUDIO_CONFIGURATION_UNKNOWN;
 using copresence::BROADCAST_AND_SCAN;
 using copresence::BROADCAST_ONLY;
@@ -52,13 +52,19 @@ void SetTokenExchangeStrategy(const Strategy* strategy,
                               BroadcastScanConfiguration default_config,
                               TokenExchangeStrategy* strategy_proto) {
   if (strategy) {
-    BroadcastScanConfiguration config = TranslateStrategy(*strategy);
-    strategy_proto->set_broadcast_scan_configuration(
-        config == BROADCAST_SCAN_CONFIGURATION_UNKNOWN ?
-        default_config : config);
+    BroadcastScanConfiguration config;
+    if (strategy->low_power && *(strategy->low_power)) {
+      config = BROADCAST_SCAN_CONFIGURATION_UNKNOWN;
+    } else {
+      config = TranslateStrategy(*strategy);
+      if (config == BROADCAST_SCAN_CONFIGURATION_UNKNOWN)
+        config = default_config;
+    }
+
+    strategy_proto->set_broadcast_scan_configuration(config);
     strategy_proto->set_audio_configuration(
-        strategy->audible && *strategy->audible ?
-        AUDIBLE : AUDIO_CONFIGURATION_UNKNOWN);
+        strategy->audible && *strategy->audible ? AUDIO_CONFIGURATION_AUDIBLE
+                                                : AUDIO_CONFIGURATION_UNKNOWN);
   } else {
     strategy_proto->set_broadcast_scan_configuration(default_config);
     strategy_proto->set_audio_configuration(AUDIO_CONFIGURATION_UNKNOWN);