OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 /* |
2 // Use of this source code is governed by a BSD-style license that can be | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 // found in the LICENSE file. | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are |
| 6 * met: |
| 7 * |
| 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above |
| 11 * copyright notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the |
| 13 * distribution. |
| 14 * * Neither the name of Google Inc. nor the names of its |
| 15 * contributors may be used to endorse or promote products derived from |
| 16 * this software without specific prior written permission. |
| 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ |
4 | 30 |
5 #ifndef WebNotificationManager_h | 31 #ifndef WebNotificationManager_h |
6 #define WebNotificationManager_h | 32 #define WebNotificationManager_h |
7 | 33 |
8 #include "WebNotificationPermission.h" | 34 #include "WebNotificationPermission.h" |
9 | 35 |
10 namespace blink { | 36 namespace blink { |
11 | 37 |
12 struct WebNotificationData; | 38 struct WebNotificationData; |
13 class WebNotificationDelegate; | 39 class WebNotificationDelegate; |
14 class WebSerializedOrigin; | 40 class WebSerializedOrigin; |
15 | 41 |
16 // Provides the services to show platform notifications to the user. | 42 // Provides the services to show platform notifications to the user. |
17 class WebNotificationManager { | 43 class WebNotificationManager { |
18 public: | 44 public: |
19 virtual ~WebNotificationManager() { } | 45 virtual ~WebNotificationManager() { } |
20 | 46 |
21 // Shows a notification on the user's system. | 47 // Shows a notification on the user's system. |
22 virtual void show(const blink::WebSerializedOrigin&, const WebNotificationDa
ta&, WebNotificationDelegate*) = 0; | 48 virtual bool show(const blink::WebSerializedOrigin&, const WebNotificationDa
ta&, WebNotificationDelegate*) = 0; |
23 | 49 |
24 // Closes a notification previously shown, and removes it if being shown. | 50 // Closes a notification previously shown, and removes it if being shown. |
25 virtual void close(WebNotificationDelegate*) = 0; | 51 virtual void close(WebNotificationDelegate*) = 0; |
26 | 52 |
27 // Indicates that the delegate object is being destroyed, and must no longer | 53 // Indicates that the delegate object is being destroyed, and must no longer |
28 // be used by the embedder to dispatch events. | 54 // be used by the embedder to dispatch events. |
29 virtual void notifyDelegateDestroyed(WebNotificationDelegate*) = 0; | 55 virtual void notifyDelegateDestroyed(WebNotificationDelegate*) = 0; |
30 | 56 |
31 // Synchronously checks the permission level for the given origin. | 57 // Checks the permission level for the given origin. |
32 virtual WebNotificationPermission checkPermission(const WebSerializedOrigin&
) = 0; | 58 virtual WebNotificationPermission checkPermission(const WebSerializedOrigin&
) = 0; |
33 }; | 59 }; |
34 | 60 |
35 } // namespace blink | 61 } // namespace blink |
36 | 62 |
37 #endif // WebNotificationManager_h | 63 #endif |
OLD | NEW |