| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Removes any notifications matching the supplied ID, either currently | 61 // Removes any notifications matching the supplied ID, either currently |
| 62 // displayed or in the queue. Returns true if anything was removed. | 62 // displayed or in the queue. Returns true if anything was removed. |
| 63 // This function can be bound for delayed execution, where a profile pointer | 63 // This function can be bound for delayed execution, where a profile pointer |
| 64 // may not be valid. Hence caller needs to call the static GetProfileID(...) | 64 // may not be valid. Hence caller needs to call the static GetProfileID(...) |
| 65 // function to turn a profile pointer into a profile id and pass that in. | 65 // function to turn a profile pointer into a profile id and pass that in. |
| 66 virtual bool CancelById(const std::string& delegate_id, | 66 virtual bool CancelById(const std::string& delegate_id, |
| 67 ProfileID profile_id) = 0; | 67 ProfileID profile_id) = 0; |
| 68 | 68 |
| 69 // Returns the set of all delegate IDs for notifications from the passed | 69 // Returns the set of all delegate IDs for notifications from the passed |
| 70 // |profile| and |source|. | 70 // |profile_id| and |source|. |
| 71 // TODO(peter): Change Profile* to ProfileID to clarify that the profile | |
| 72 // should not be used for making any calls, as it might be dead. | |
| 73 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( | 71 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
| 74 Profile* profile, | 72 ProfileID profile_id, |
| 75 const GURL& source) = 0; | 73 const GURL& source) = 0; |
| 76 | 74 |
| 77 // Returns the set of all delegate IDs for notifications from |profile|. | 75 // Returns the set of all delegate IDs for notifications from |profile_id|. |
| 78 // TODO(peter): Change Profile* to ProfileID to clarify that the profile | 76 virtual std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) = 0; |
| 79 // should not be used for making any calls, as it might be dead. | |
| 80 virtual std::set<std::string> GetAllIdsByProfile(Profile* profile) = 0; | |
| 81 | 77 |
| 82 // Removes notifications matching the |source_origin| (which could be an | 78 // Removes notifications matching the |source_origin| (which could be an |
| 83 // extension ID). Returns true if anything was removed. | 79 // extension ID). Returns true if anything was removed. |
| 84 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) = 0; | 80 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) = 0; |
| 85 | 81 |
| 86 // Removes notifications matching |profile_id|. Returns true if any were | 82 // Removes notifications matching |profile_id|. Returns true if any were |
| 87 // removed. | 83 // removed. |
| 88 virtual bool CancelAllByProfile(ProfileID profile_id) = 0; | 84 virtual bool CancelAllByProfile(ProfileID profile_id) = 0; |
| 89 | 85 |
| 90 // Cancels all pending notifications and closes anything currently showing. | 86 // Cancels all pending notifications and closes anything currently showing. |
| 91 // Used when the app is terminating. | 87 // Used when the app is terminating. |
| 92 virtual void CancelAll() = 0; | 88 virtual void CancelAll() = 0; |
| 93 | 89 |
| 94 protected: | 90 protected: |
| 95 NotificationUIManager() {} | 91 NotificationUIManager() {} |
| 96 | 92 |
| 97 private: | 93 private: |
| 98 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); | 94 DISALLOW_COPY_AND_ASSIGN(NotificationUIManager); |
| 99 }; | 95 }; |
| 100 | 96 |
| 101 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ | 97 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_ |
| OLD | NEW |