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

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

Issue 580093003: Factor Google Now welcome notifications out of DesktopNotificationService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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/notifications/extension_welcome_notification_factory.h
diff --git a/chrome/browser/notifications/extension_welcome_notification_factory.h b/chrome/browser/notifications/extension_welcome_notification_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..975ab1436abe0ca0ef6abf278a8e418b9db00e6e
--- /dev/null
+++ b/chrome/browser/notifications/extension_welcome_notification_factory.h
@@ -0,0 +1,37 @@
+// 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_EXTENSION_WELCOME_NOTIFICATION_FACTORY_H_
+#define CHROME_BROWSER_NOTIFICATIONS_EXTENSION_WELCOME_NOTIFICATION_FACTORY_H_
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+class ExtensionWelcomeNotification;
+
+// Singleton owning the extension welcome notification objects and associates
+// them with the browser context for which they may have to be shown.
+class ExtensionWelcomeNotificationFactory
+ : public BrowserContextKeyedServiceFactory {
+ public:
+ // Returns the ExtensionWelcomeNotification instance to be used for |context|.
+ static ExtensionWelcomeNotification* GetForBrowserContext(
+ content::BrowserContext* context);
+
+ static ExtensionWelcomeNotificationFactory* GetInstance();
+
+ private:
+ friend struct DefaultSingletonTraits<ExtensionWelcomeNotificationFactory>;
+
+ ExtensionWelcomeNotificationFactory();
+ virtual ~ExtensionWelcomeNotificationFactory();
+
+ // BrowserContextKeyedServiceFactory:
+ virtual KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const OVERRIDE;
+ virtual content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* context) const OVERRIDE;
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_EXTENSION_WELCOME_NOTIFICATION_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698