OLD | NEW |
---|---|
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/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/notifications/non_persistent_notification_handler.h" | 9 #include "chrome/browser/notifications/notification_handler.h" |
10 | |
11 #include "extensions/browser/event_router.h" | |
Peter Beverloo
2017/05/15 15:56:52
nit: no blank line
Miguel Garcia
2017/05/16 11:01:34
Done.
| |
12 | |
13 class Profile; | |
14 | |
15 namespace extensions { | |
10 | 16 |
11 // Handler for notifications shown by extensions. Will be created and owned by | 17 // Handler for notifications shown by extensions. Will be created and owned by |
12 // the NotificationDisplayService. | 18 // the NativeNotificationDisplayService. |
13 class ExtensionNotificationHandler : public NonPersistentNotificationHandler { | 19 class ExtensionNotificationHandler : public NotificationHandler { |
14 public: | 20 public: |
15 ExtensionNotificationHandler(); | 21 ExtensionNotificationHandler(); |
16 ~ExtensionNotificationHandler() override; | 22 ~ExtensionNotificationHandler() override; |
17 | 23 |
18 // NotificationHandler implementation. | 24 void OnClose(Profile* profile, |
Peter Beverloo
2017/05/15 15:56:52
Please keep this. Also remove the blank lines on :
Miguel Garcia
2017/05/16 11:01:34
Done.
| |
25 const std::string& origin, | |
26 const std::string& notification_id, | |
27 bool by_user) override; | |
28 | |
29 void OnClick(Profile* profile, | |
30 const std::string& origin, | |
31 const std::string& notification_id, | |
32 int action_index, | |
33 const base::NullableString16& reply) override; | |
34 | |
19 void OpenSettings(Profile* profile) override; | 35 void OpenSettings(Profile* profile) override; |
20 | 36 |
37 void RegisterNotification(const std::string& notification_id, | |
38 NotificationDelegate* delegate) override; | |
39 | |
21 private: | 40 private: |
41 void SendEvent(Profile* profile, | |
42 const std::string& extension_id, | |
43 events::HistogramValue histogram_value, | |
44 const std::string& name, | |
45 EventRouter::UserGestureState user_gesture, | |
46 std::unique_ptr<base::ListValue> args); | |
47 | |
22 DISALLOW_COPY_AND_ASSIGN(ExtensionNotificationHandler); | 48 DISALLOW_COPY_AND_ASSIGN(ExtensionNotificationHandler); |
23 }; | 49 }; |
24 | 50 |
51 } // namespace extensions | |
25 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HA NDLER_H_ | 52 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HA NDLER_H_ |
Peter Beverloo
2017/05/15 15:56:52
nit: blank line after 51
Miguel Garcia
2017/05/16 11:01:34
Done.
| |
OLD | NEW |