OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 ASSERT_NOT_REACHED(); | 153 ASSERT_NOT_REACHED(); |
154 return deniedPermission; | 154 return deniedPermission; |
155 } | 155 } |
156 | 156 |
157 const String& Notification::permission(ExecutionContext* context) | 157 const String& Notification::permission(ExecutionContext* context) |
158 { | 158 { |
159 return permissionString(NotificationController::clientFrom(context).checkPer
mission(context)); | 159 return permissionString(NotificationController::clientFrom(context).checkPer
mission(context)); |
160 } | 160 } |
161 | 161 |
162 void Notification::requestPermission(ExecutionContext* context, PassOwnPtrWillBe
RawPtr<NotificationPermissionCallback> callback) | 162 void Notification::requestPermission(ExecutionContext* context, NotificationPerm
issionCallback* callback) |
163 { | 163 { |
164 // FIXME: Assert that this code-path will only be reached for Document envir
onments | 164 // FIXME: Assert that this code-path will only be reached for Document envir
onments |
165 // when Blink supports [Exposed] annotations on class members in IDL definit
ions. | 165 // when Blink supports [Exposed] annotations on class members in IDL definit
ions. |
166 if (NotificationPermissionClient* permissionClient = NotificationPermissionC
lient::from(context)) { | 166 if (NotificationPermissionClient* permissionClient = NotificationPermissionC
lient::from(context)) { |
167 permissionClient->requestPermission(context, callback); | 167 permissionClient->requestPermission(context, callback); |
168 return; | 168 return; |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 bool Notification::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) | 172 bool Notification::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |
(...skipping 19 matching lines...) Expand all Loading... |
192 | 192 |
193 m_asyncRunner.stop(); | 193 m_asyncRunner.stop(); |
194 } | 194 } |
195 | 195 |
196 bool Notification::hasPendingActivity() const | 196 bool Notification::hasPendingActivity() const |
197 { | 197 { |
198 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); | 198 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); |
199 } | 199 } |
200 | 200 |
201 } // namespace blink | 201 } // namespace blink |
OLD | NEW |