Index: chrome/browser/local_discovery/privet_notifications.cc |
diff --git a/chrome/browser/local_discovery/privet_notifications.cc b/chrome/browser/local_discovery/privet_notifications.cc |
index cf3b5ec11e695efcfad1d4bcebf69efb2efe695c..ffa5ec37692cdb0c8664d2aae6507243f71156b0 100644 |
--- a/chrome/browser/local_discovery/privet_notifications.cc |
+++ b/chrome/browser/local_discovery/privet_notifications.cc |
@@ -14,7 +14,6 @@ |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/local_discovery/privet_device_lister_impl.h" |
#include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" |
-#include "chrome/browser/local_discovery/privet_traffic_detector.h" |
#include "chrome/browser/local_discovery/service_discovery_shared_client.h" |
#include "chrome/browser/notifications/notification.h" |
#include "chrome/browser/notifications/notification_ui_manager.h" |
@@ -40,6 +39,10 @@ |
#include "ui/message_center/message_center_util.h" |
#include "ui/message_center/notifier_settings.h" |
+#if defined(ENABLE_MDNS) |
+#include "chrome/browser/local_discovery/privet_traffic_detector.h" |
+#endif |
+ |
namespace local_discovery { |
namespace { |
@@ -304,6 +307,7 @@ void PrivetNotificationService::Start() { |
} |
void PrivetNotificationService::OnNotificationsEnabledChanged() { |
+#if defined(ENABLE_MDNS) |
if (IsForced()) { |
StartLister(); |
} else if (*enable_privet_notification_member_) { |
@@ -319,12 +323,22 @@ void PrivetNotificationService::OnNotificationsEnabledChanged() { |
service_discovery_client_ = NULL; |
privet_notifications_listener_.reset(); |
} |
+#else |
+ if (IsForced() || *enable_privet_notification_member_) { |
+ StartLister(); |
+ } else { |
+ device_lister_.reset(); |
+ service_discovery_client_ = NULL; |
+ privet_notifications_listener_.reset(); |
+ } |
+#endif |
} |
void PrivetNotificationService::StartLister() { |
ReportPrivetUmaEvent(PRIVET_LISTER_STARTED); |
+#if defined(ENABLE_MDNS) |
traffic_detector_ = NULL; |
- DCHECK(!service_discovery_client_); |
+#endif // ENABLE_MDNS |
service_discovery_client_ = ServiceDiscoverySharedClient::GetInstance(); |
device_lister_.reset(new PrivetDeviceListerImpl(service_discovery_client_, |
this)); |