Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_NOTIFICATIONS_NOTIFICATION_COMMON_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_COMMON_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_COMMON_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_COMMON_H_ |
| 7 | 7 |
| 8 #include <set> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/callback.h" | |
| 12 | |
| 8 namespace content { | 13 namespace content { |
| 9 class BrowserContext; | 14 class BrowserContext; |
| 10 } // namespace content | 15 } // namespace content |
| 11 | 16 |
| 12 // Shared functionality for both in page and persistent notification | 17 // Shared functionality for both in page and persistent notification |
| 13 class NotificationCommon { | 18 class NotificationCommon { |
| 14 public: | 19 public: |
| 20 using NotificationResultCallback = | |
|
Peter Beverloo
2017/02/24 16:12:23
Let's define this type on the NotificationDisplayS
| |
| 21 base::Callback<void(std::unique_ptr<std::set<std::string>>, | |
| 22 bool /* success */)>; | |
| 23 | |
| 15 // Things as user can do to a notification. | 24 // Things as user can do to a notification. |
| 16 enum Operation { | 25 enum Operation { |
| 17 CLICK = 0, | 26 CLICK = 0, |
| 18 CLOSE = 1, | 27 CLOSE = 1, |
| 19 SETTINGS = 2, | 28 SETTINGS = 2, |
| 20 OPERATION_MAX = SETTINGS | 29 OPERATION_MAX = SETTINGS |
| 21 }; | 30 }; |
| 22 | 31 |
| 23 // Possible kinds of notifications | 32 // Possible kinds of notifications |
| 24 enum Type { | 33 enum Type { |
| 25 PERSISTENT = 0, | 34 PERSISTENT = 0, |
| 26 NON_PERSISTENT = 1, | 35 NON_PERSISTENT = 1, |
| 27 TYPE_MAX = NON_PERSISTENT | 36 TYPE_MAX = NON_PERSISTENT |
| 28 }; | 37 }; |
| 29 | 38 |
| 30 // Open the Notification settings screen when clicking the right button. | 39 // Open the Notification settings screen when clicking the right button. |
| 31 // TODO(miguelg) have it take a Profile instead once NotificationObjectProxy | 40 // TODO(miguelg) have it take a Profile instead once NotificationObjectProxy |
| 32 // is updated. | 41 // is updated. |
| 33 static void OpenNotificationSettings( | 42 static void OpenNotificationSettings( |
| 34 content::BrowserContext* browser_context); | 43 content::BrowserContext* browser_context); |
| 35 }; | 44 }; |
| 36 | 45 |
| 37 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_COMMON_H_ | 46 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_COMMON_H_ |
| OLD | NEW |