| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "bindings/v8/ScriptWrappable.h" | 36 #include "bindings/v8/ScriptWrappable.h" |
| 37 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
| 38 #include "core/dom/ExecutionContext.h" | 38 #include "core/dom/ExecutionContext.h" |
| 39 #include "modules/notifications/NotificationController.h" | 39 #include "modules/notifications/NotificationController.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 PassRefPtrWillBeRawPtr<Notification> Notification::create(ExecutionContext* cont
ext, const String& title, const Dictionary& options) | 43 PassRefPtrWillBeRawPtr<Notification> Notification::create(ExecutionContext* cont
ext, const String& title, const Dictionary& options) |
| 44 { | 44 { |
| 45 NotificationClient* client = NotificationController::clientFrom(toDocument(c
ontext)->page()); | 45 NotificationClient* client = NotificationController::clientFrom(toDocument(c
ontext)->page()); |
| 46 RefPtrWillBeRawPtr<Notification> notification = adoptRefCountedWillBeRefCoun
tedGarbageCollected(new Notification(context, title, client)); | 46 RefPtrWillBeRawPtr<Notification> notification = adoptRefWillBeRefCountedGarb
ageCollected(new Notification(context, title, client)); |
| 47 | 47 |
| 48 String argument; | 48 String argument; |
| 49 if (options.get("body", argument)) | 49 if (options.get("body", argument)) |
| 50 notification->setBody(argument); | 50 notification->setBody(argument); |
| 51 if (options.get("tag", argument)) | 51 if (options.get("tag", argument)) |
| 52 notification->setTag(argument); | 52 notification->setTag(argument); |
| 53 if (options.get("lang", argument)) | 53 if (options.get("lang", argument)) |
| 54 notification->setLang(argument); | 54 notification->setLang(argument); |
| 55 if (options.get("dir", argument)) | 55 if (options.get("dir", argument)) |
| 56 notification->setDir(argument); | 56 notification->setDir(argument); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 return NotificationBase::hasPendingActivity() || (m_asyncRunner && m_asyncRu
nner->isActive()); | 106 return NotificationBase::hasPendingActivity() || (m_asyncRunner && m_asyncRu
nner->isActive()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void Notification::showSoon() | 109 void Notification::showSoon() |
| 110 { | 110 { |
| 111 ASSERT(executionContext()->isDocument()); | 111 ASSERT(executionContext()->isDocument()); |
| 112 show(); | 112 show(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace WebCore | 115 } // namespace WebCore |
| OLD | NEW |