| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 UseCounter::NotificationPermissionRequestedIframe); | 373 UseCounter::NotificationPermissionRequestedIframe); |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 if (!UserGestureIndicator::processingUserGesture()) { | 377 if (!UserGestureIndicator::processingUserGesture()) { |
| 378 PerformanceMonitor::reportGenericViolation( | 378 PerformanceMonitor::reportGenericViolation( |
| 379 context, PerformanceMonitor::kDiscouragedAPIUse, | 379 context, PerformanceMonitor::kDiscouragedAPIUse, |
| 380 "Only request notification permission in response to a user gesture.", | 380 "Only request notification permission in response to a user gesture.", |
| 381 0, nullptr); | 381 0, nullptr); |
| 382 } | 382 } |
| 383 probe::breakIfNeeded(context, "Notification.requestPermission"); | 383 probe::breakableLocation(context, "Notification.requestPermission"); |
| 384 | 384 |
| 385 return NotificationManager::from(context)->requestPermission( | 385 return NotificationManager::from(context)->requestPermission( |
| 386 scriptState, deprecatedCallback); | 386 scriptState, deprecatedCallback); |
| 387 } | 387 } |
| 388 | 388 |
| 389 size_t Notification::maxActions() { | 389 size_t Notification::maxActions() { |
| 390 return kWebNotificationMaxActions; | 390 return kWebNotificationMaxActions; |
| 391 } | 391 } |
| 392 | 392 |
| 393 DispatchEventResult Notification::dispatchEventInternal(Event* event) { | 393 DispatchEventResult Notification::dispatchEventInternal(Event* event) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 421 } | 421 } |
| 422 | 422 |
| 423 DEFINE_TRACE(Notification) { | 423 DEFINE_TRACE(Notification) { |
| 424 visitor->trace(m_prepareShowMethodRunner); | 424 visitor->trace(m_prepareShowMethodRunner); |
| 425 visitor->trace(m_loader); | 425 visitor->trace(m_loader); |
| 426 EventTargetWithInlineData::trace(visitor); | 426 EventTargetWithInlineData::trace(visitor); |
| 427 ContextLifecycleObserver::trace(visitor); | 427 ContextLifecycleObserver::trace(visitor); |
| 428 } | 428 } |
| 429 | 429 |
| 430 } // namespace blink | 430 } // namespace blink |
| OLD | NEW |