Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_BRIDGE_H_ | |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_BRIDGE_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 #include <string> | |
| 10 #include "base/macros.h" | |
|
Peter Beverloo
2016/04/18 14:57:09
micro nit: don't we usually have blank lines betwe
Miguel Garcia
2016/04/19 14:24:57
Done.
| |
| 11 | |
| 12 class Notification; | |
| 13 | |
| 14 // This class bridges the display and click operations available on a | |
| 15 // notification. | |
|
Peter Beverloo
2016/04/18 14:57:09
Let's try to be a bit more inclusive. What about:
Miguel Garcia
2016/04/19 14:24:57
Except that right now there is no bridge for chrom
| |
| 16 // TODO(miguelg): Add support for click and close events. | |
| 17 class NotificationBridge { | |
| 18 public: | |
| 19 static NotificationBridge* Create(); | |
| 20 | |
| 21 NotificationBridge() {} | |
|
Peter Beverloo
2016/04/18 14:57:09
If we need a static Create method, let's make the
Miguel Garcia
2016/04/19 14:24:57
Done.
| |
| 22 virtual ~NotificationBridge() {} | |
| 23 | |
| 24 // Shows a toast on screen using the data passed in |notification|. | |
| 25 virtual void Display(const std::string& notification_id, | |
| 26 const std::string& profile_id, | |
| 27 bool is_incognito, | |
| 28 const Notification& notification) = 0; | |
| 29 | |
| 30 // Closes a nofication with |notification_id| and |profile_id| if being | |
| 31 // displayed. | |
| 32 virtual void Close(const std::string& profile_id, | |
| 33 const std::string& notification_id) = 0; | |
| 34 | |
| 35 // Fills in |notifications| with a set of notification ids currently being | |
| 36 // displayed for a given profile. | |
| 37 // The return value expresses whether the underlying platform has the | |
| 38 // capability to provide displayed notifications so the empty set | |
| 39 // can be disambiguated. | |
| 40 virtual bool GetDisplayed(const std::string& profile_id, | |
| 41 bool incognito, | |
| 42 std::set<std::string>* notification_ids) const = 0; | |
| 43 | |
| 44 // Temporary method while the refactor is finished. | |
|
Peter Beverloo
2016/04/18 14:57:09
Please do document what it does and why it's signi
Miguel Garcia
2016/04/19 14:24:57
Done.
| |
| 45 virtual bool SupportsNotificationCenter() const = 0; | |
| 46 | |
| 47 private: | |
| 48 DISALLOW_COPY_AND_ASSIGN(NotificationBridge); | |
| 49 }; | |
| 50 | |
| 51 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_BRIDGE_H_ | |
| OLD | NEW |