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

Unified Diff: chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc

Issue 780363003: Delete deprecated synced notifications code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/notifications/sync_notifier/chrome_notifier_service.cc
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc
deleted file mode 100644
index c85fa07830561974947023c5edc27c1cc08db21c..0000000000000000000000000000000000000000
--- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// The ChromeNotifierService works together with sync to maintain the state of
-// user notifications, which can then be presented in the notification center,
-// via the Notification UI Manager.
-
-#include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
-
-#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/extensions/api/synced_notifications_private/synced_notifications_shim.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/notification_service.h"
-#include "extensions/browser/event_router.h"
-
-namespace notifier {
-
-ChromeNotifierService::ChromeNotifierService(Profile* profile)
- : profile_(profile),
- weak_ptr_factory_(this) {
- synced_notifications_shim_.reset(new SyncedNotificationsShim(
- base::Bind(&ChromeNotifierService::FireSyncJSEvent,
- weak_ptr_factory_.GetWeakPtr()),
- base::Bind(&ChromeNotifierService::NotifyRefreshNeeded,
- weak_ptr_factory_.GetWeakPtr())));
-}
-
-ChromeNotifierService::~ChromeNotifierService() {
-}
-
-// Methods from KeyedService.
-void ChromeNotifierService::Shutdown() {}
-
-SyncedNotificationsShim* ChromeNotifierService::GetSyncedNotificationsShim() {
- return synced_notifications_shim_.get();
-}
-
-void ChromeNotifierService::FireSyncJSEvent(
- scoped_ptr<extensions::Event> event) {
- event->restrict_to_browser_context = profile_;
- // TODO(synced notifications): consider broadcasting to a specific extension
- // id.
- extensions::EventRouter::Get(profile_)->BroadcastEvent(event.Pass());
-}
-
-void ChromeNotifierService::NotifyRefreshNeeded() {
- const syncer::ModelTypeSet types(syncer::SYNCED_NOTIFICATIONS);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
- content::Source<Profile>(profile_),
- content::Details<const syncer::ModelTypeSet>(&types));
-}
-
-} // namespace notifier

Powered by Google App Engine
This is Rietveld 408576698