| 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 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint( | 383 InspectorInstrumentation::breakIfNeeded(context, |
| 384 context, "Notification.requestPermission", true); | 384 "Notification.requestPermission"); |
| 385 | 385 |
| 386 return NotificationManager::from(context)->requestPermission( | 386 return NotificationManager::from(context)->requestPermission( |
| 387 scriptState, deprecatedCallback); | 387 scriptState, deprecatedCallback); |
| 388 } | 388 } |
| 389 | 389 |
| 390 size_t Notification::maxActions() { | 390 size_t Notification::maxActions() { |
| 391 return kWebNotificationMaxActions; | 391 return kWebNotificationMaxActions; |
| 392 } | 392 } |
| 393 | 393 |
| 394 DispatchEventResult Notification::dispatchEventInternal(Event* event) { | 394 DispatchEventResult Notification::dispatchEventInternal(Event* event) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 422 } | 422 } |
| 423 | 423 |
| 424 DEFINE_TRACE(Notification) { | 424 DEFINE_TRACE(Notification) { |
| 425 visitor->trace(m_prepareShowMethodRunner); | 425 visitor->trace(m_prepareShowMethodRunner); |
| 426 visitor->trace(m_loader); | 426 visitor->trace(m_loader); |
| 427 EventTargetWithInlineData::trace(visitor); | 427 EventTargetWithInlineData::trace(visitor); |
| 428 ContextLifecycleObserver::trace(visitor); | 428 ContextLifecycleObserver::trace(visitor); |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace blink | 431 } // namespace blink |
| OLD | NEW |