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

Side by Side Diff: chrome/browser/extensions/api/notifications/extension_notification_handler.h

Issue 2941743002: Revert of Deprecate native and extension notification delegates. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_
7 7
8 #include "base/feature_list.h"
9 #include "base/macros.h" 8 #include "base/macros.h"
10 #include "chrome/browser/notifications/notification_handler.h" 9 #include "chrome/browser/notifications/notification_handler.h"
11 #include "extensions/browser/event_router.h" 10 #include "extensions/browser/event_router.h"
12 11
13 class Profile; 12 class Profile;
14 13
15 namespace extensions { 14 namespace extensions {
16 15
17 // Exposed publicly for tests.
18 // TODO(miguelg) we can probably get rid of this now.
19 extern const base::Feature kAllowFullscreenAppNotificationsFeature;
20
21 // Handler for notifications shown by extensions. Will be created and owned by 16 // Handler for notifications shown by extensions. Will be created and owned by
22 // the NativeNotificationDisplayService. 17 // the NativeNotificationDisplayService.
23 class ExtensionNotificationHandler : public NotificationHandler { 18 class ExtensionNotificationHandler : public NotificationHandler {
24 public: 19 public:
25 ExtensionNotificationHandler(); 20 ExtensionNotificationHandler();
26 ~ExtensionNotificationHandler() override; 21 ~ExtensionNotificationHandler() override;
27 22
28 // NotificationHandler implementation. 23 // NotificationHandler implementation.
29 void OnShow(Profile* profile, const std::string& notification_id) override; 24 void OnShow(Profile* profile, const std::string& notification_id) override;
30 void OnClose(Profile* profile, 25 void OnClose(Profile* profile,
31 const std::string& origin, 26 const std::string& origin,
32 const std::string& notification_id, 27 const std::string& notification_id,
33 bool by_user) override; 28 bool by_user) override;
34 void OnClick(Profile* profile, 29 void OnClick(Profile* profile,
35 const std::string& origin, 30 const std::string& origin,
36 const std::string& notification_id, 31 const std::string& notification_id,
37 int action_index, 32 int action_index,
38 const base::NullableString16& reply) override; 33 const base::NullableString16& reply) override;
39 void OpenSettings(Profile* profile) override; 34 void OpenSettings(Profile* profile) override;
40 bool ShouldDisplayOnFullScreen(Profile* profile,
41 const std::string& origin) override;
42 35
43 protected: 36 protected:
44 // Overriden in unit tests. 37 // Overriden in unit tests.
45 virtual void SendEvent(Profile* profile, 38 virtual void SendEvent(Profile* profile,
46 const std::string& extension_id, 39 const std::string& extension_id,
47 events::HistogramValue histogram_value, 40 events::HistogramValue histogram_value,
48 const std::string& name, 41 const std::string& name,
49 EventRouter::UserGestureState user_gesture, 42 EventRouter::UserGestureState user_gesture,
50 std::unique_ptr<base::ListValue> args); 43 std::unique_ptr<base::ListValue> args);
51 44
52 DISALLOW_COPY_AND_ASSIGN(ExtensionNotificationHandler); 45 DISALLOW_COPY_AND_ASSIGN(ExtensionNotificationHandler);
53 }; 46 };
54 47
55 } // namespace extensions 48 } // namespace extensions
56 49
57 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HA NDLER_H_ 50 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HA NDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/extensions/api/notifications/extension_notification_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698