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

Unified Diff: chrome/browser/notifications/platform_notification_service_impl.h

Issue 774573003: Start pulling away notification logic from ChromeContentBrowserClient. (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/platform_notification_service_impl.h
diff --git a/chrome/browser/notifications/platform_notification_service_impl.h b/chrome/browser/notifications/platform_notification_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..51700d16e72ea1a252af73b6639d355a569a46e0
--- /dev/null
+++ b/chrome/browser/notifications/platform_notification_service_impl.h
@@ -0,0 +1,39 @@
+// Copyright 2014 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.
+
+#ifndef CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
+#define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
+
+#include "base/memory/singleton.h"
+#include "content/public/browser/platform_notification_service.h"
+
+// The platform notification service is the profile-agnostic entry point through
+// which Web Notifications can be controlled.
+class PlatformNotificationServiceImpl
+ : public content::PlatformNotificationService {
+ public:
+ // Returns the active instance of the service in the browser process. Safe to
+ // be called from any thread.
+ static PlatformNotificationServiceImpl* GetInstance();
+
+ // content::PlatformNotificationService implementation.
+ blink::WebNotificationPermission CheckPermission(
+ content::ResourceContext* resource_context,
+ const GURL& origin,
+ int render_process_id) override;;
+ void DisplayNotification(
+ content::BrowserContext* browser_context,
+ const content::ShowDesktopNotificationHostMsgParams& params,
+ scoped_ptr<content::DesktopNotificationDelegate> delegate,
+ int render_process_id,
+ base::Closure* cancel_callback) override;
+
+ private:
+ friend struct DefaultSingletonTraits<PlatformNotificationServiceImpl>;
+
+ PlatformNotificationServiceImpl();
+ ~PlatformNotificationServiceImpl() override;
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/notifications/platform_notification_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698