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

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

Issue 23903024: Enable device discovery notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 b378a64097150e0c253268c11f8694430af14bc0..e5c329aa3d398d35e7159f6cefec72a2c6efb558 100644
--- a/chrome/browser/local_discovery/privet_notifications.cc
+++ b/chrome/browser/local_discovery/privet_notifications.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "base/rand_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/local_discovery/privet_device_lister_impl.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/profiles/profile.h"
@@ -148,10 +149,8 @@ PrivetNotificationsListener::DeviceContext::~DeviceContext() {
}
PrivetNotificationService::PrivetNotificationService(
- content::BrowserContext* profile,
- NotificationUIManager* notification_manager)
- : profile_(profile),
- notification_manager_(notification_manager) {
+ content::BrowserContext* profile)
+ : profile_(profile) {
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrivetNotificationService::Start, AsWeakPtr()),
@@ -210,13 +209,15 @@ void PrivetNotificationService::PrivetNotify(
rich_notification_data,
new PrivetNotificationDelegate(device_name, profile_));
- notification_manager_->Add(notification, profile_object);
+ g_browser_process->notification_ui_manager()->Add(notification,
+ profile_object);
}
}
void PrivetNotificationService::PrivetRemoveNotification(
const std::string& device_name) {
- notification_manager_->CancelById(kPrivetNotificationIDPrefix + device_name);
+ g_browser_process->notification_ui_manager()->CancelById(
+ kPrivetNotificationIDPrefix + device_name);
}
void PrivetNotificationService::Start() {
« no previous file with comments | « chrome/browser/local_discovery/privet_notifications.h ('k') | chrome/browser/local_discovery/privet_notifications_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698