Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: chrome/browser/local_discovery/privet_notifications.cc

Issue 195983023: Enable devices page UI on MacOSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_dcheck
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
« no previous file with comments | « chrome/browser/local_discovery/privet_notifications.h ('k') | chrome/browser/local_discovery/storage/privet_volume_lister.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698