OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PUSH_MESSAGING_PUSH_MESSAGING_NOTIFICATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_NOTIFICATION_MANAGER_H_ |
6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_NOTIFICATION_MANAGER_H_ | 6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_NOTIFICATION_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 bool success, | 66 bool success, |
67 const std::vector<content::NotificationDatabaseData>& data); | 67 const std::vector<content::NotificationDatabaseData>& data); |
68 | 68 |
69 // Checks whether |profile| is the one owning this instance, | 69 // Checks whether |profile| is the one owning this instance, |
70 // |active_web_contents| exists and its main frame is visible, and the URL | 70 // |active_web_contents| exists and its main frame is visible, and the URL |
71 // currently visible to the user is for |origin|. | 71 // currently visible to the user is for |origin|. |
72 bool IsTabVisible(Profile* profile, | 72 bool IsTabVisible(Profile* profile, |
73 content::WebContents* active_web_contents, | 73 content::WebContents* active_web_contents, |
74 const GURL& origin); | 74 const GURL& origin); |
75 | 75 |
76 void CheckForMissedNotification(const GURL& origin, | 76 void ProcessSilentPush(const GURL& origin, |
77 int64_t service_worker_registration_id, | 77 int64_t service_worker_registration_id, |
78 const base::Closure& message_handled_closure, | 78 const base::Closure& message_handled_closure, |
79 const double budget); | 79 bool silent_push_allowed); |
80 | 80 |
81 static void DidWriteNotificationDataIOProxy( | 81 static void DidWriteNotificationDataIOProxy( |
82 const base::WeakPtr<PushMessagingNotificationManager>& ui_weak_ptr, | 82 const base::WeakPtr<PushMessagingNotificationManager>& ui_weak_ptr, |
83 const GURL& origin, | 83 const GURL& origin, |
84 const content::PlatformNotificationData& notification_data, | 84 const content::PlatformNotificationData& notification_data, |
85 const base::Closure& message_handled_closure, | 85 const base::Closure& message_handled_closure, |
86 bool success, | 86 bool success, |
87 int64_t persistent_notification_id); | 87 int64_t persistent_notification_id); |
88 | 88 |
89 void DidWriteNotificationData( | 89 void DidWriteNotificationData( |
90 const GURL& origin, | 90 const GURL& origin, |
91 const content::PlatformNotificationData& notification_data, | 91 const content::PlatformNotificationData& notification_data, |
92 const base::Closure& message_handled_closure, | 92 const base::Closure& message_handled_closure, |
93 bool success, | 93 bool success, |
94 int64_t persistent_notification_id); | 94 int64_t persistent_notification_id); |
95 | 95 |
96 void DidGetBudget(const GURL& origin, | |
97 int64_t service_worker_registration_id, | |
98 const base::Closure& message_handled_closure, | |
99 bool notification_needed, | |
100 bool notification_shown, | |
101 double budget); | |
102 | |
103 // Weak. This manager is owned by a keyed service on this profile. | 96 // Weak. This manager is owned by a keyed service on this profile. |
104 Profile* profile_; | 97 Profile* profile_; |
105 | 98 |
106 base::WeakPtrFactory<PushMessagingNotificationManager> weak_factory_; | 99 base::WeakPtrFactory<PushMessagingNotificationManager> weak_factory_; |
107 | 100 |
108 DISALLOW_COPY_AND_ASSIGN(PushMessagingNotificationManager); | 101 DISALLOW_COPY_AND_ASSIGN(PushMessagingNotificationManager); |
109 }; | 102 }; |
110 | 103 |
111 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_NOTIFICATION_MANAGER_H_ | 104 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_NOTIFICATION_MANAGER_H_ |
OLD | NEW |