Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: Source/modules/notifications/Notification.cpp

Issue 1254423011: Add Notification.maxActions so websites know how many buttons we support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@staticreadonlypeter
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 288
289 void Notification::requestPermission(ExecutionContext* context, NotificationPerm issionCallback* callback) 289 void Notification::requestPermission(ExecutionContext* context, NotificationPerm issionCallback* callback)
290 { 290 {
291 // FIXME: Assert that this code-path will only be reached for Document envir onments 291 // FIXME: Assert that this code-path will only be reached for Document envir onments
292 // when Blink supports [Exposed] annotations on class members in IDL definit ions. 292 // when Blink supports [Exposed] annotations on class members in IDL definit ions.
293 if (NotificationPermissionClient* permissionClient = NotificationPermissionC lient::from(context)) 293 if (NotificationPermissionClient* permissionClient = NotificationPermissionC lient::from(context))
294 permissionClient->requestPermission(context, callback); 294 permissionClient->requestPermission(context, callback);
295 } 295 }
296 296
297 unsigned Notification::maxActions()
298 {
299 return notificationManager()->maxActions();
300 }
301
297 bool Notification::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) 302 bool Notification::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
298 { 303 {
299 ASSERT(executionContext()->isContextThread()); 304 ASSERT(executionContext()->isContextThread());
300 return EventTarget::dispatchEventInternal(event); 305 return EventTarget::dispatchEventInternal(event);
301 } 306 }
302 307
303 const AtomicString& Notification::interfaceName() const 308 const AtomicString& Notification::interfaceName() const
304 { 309 {
305 return EventTargetNames::Notification; 310 return EventTargetNames::Notification;
306 } 311 }
(...skipping 20 matching lines...) Expand all
327 return ScriptValue(scriptState, m_serializedData->deserialize(scriptState->i solate())); 332 return ScriptValue(scriptState, m_serializedData->deserialize(scriptState->i solate()));
328 } 333 }
329 334
330 DEFINE_TRACE(Notification) 335 DEFINE_TRACE(Notification)
331 { 336 {
332 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis itor); 337 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis itor);
333 ActiveDOMObject::trace(visitor); 338 ActiveDOMObject::trace(visitor);
334 } 339 }
335 340
336 } // namespace blink 341 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698