| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE FINAL; | 88 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE FINAL; |
| 89 virtual const AtomicString& interfaceName() const OVERRIDE; | 89 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 90 | 90 |
| 91 // ActiveDOMObject interface. | 91 // ActiveDOMObject interface. |
| 92 virtual void stop() OVERRIDE; | 92 virtual void stop() OVERRIDE; |
| 93 virtual bool hasPendingActivity() const OVERRIDE; | 93 virtual bool hasPendingActivity() const OVERRIDE; |
| 94 | 94 |
| 95 void trace(Visitor*) { } | 95 void trace(Visitor*) { } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 Notification(const String& title, ExecutionContext*, NotificationClient*); | 98 Notification(const String& title, ExecutionContext*, NotificationClient&); |
| 99 | 99 |
| 100 // Calling show() may start asynchronous operation. If this object has | 100 // Calling show() may start asynchronous operation. If this object has |
| 101 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being | 101 // a V8 wrapper, hasPendingActivity() prevents the wrapper from being |
| 102 // collected while m_state is Showing, and so this instance stays alive | 102 // collected while m_state is Showing, and so this instance stays alive |
| 103 // until the operation completes. Otherwise, you need to hold a ref on this | 103 // until the operation completes. Otherwise, you need to hold a ref on this |
| 104 // instance until the operation completes. | 104 // instance until the operation completes. |
| 105 void show(); | 105 void show(); |
| 106 | 106 |
| 107 void setDir(const String& dir) { m_dir = dir; } | 107 void setDir(const String& dir) { m_dir = dir; } |
| 108 void setLang(const String& lang) { m_lang = lang; } | 108 void setLang(const String& lang) { m_lang = lang; } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 120 KURL m_iconUrl; | 120 KURL m_iconUrl; |
| 121 | 121 |
| 122 enum NotificationState { | 122 enum NotificationState { |
| 123 Idle = 0, | 123 Idle = 0, |
| 124 Showing = 1, | 124 Showing = 1, |
| 125 Closed = 2, | 125 Closed = 2, |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 NotificationState m_state; | 128 NotificationState m_state; |
| 129 | 129 |
| 130 NotificationClient* m_client; | 130 NotificationClient& m_client; |
| 131 | 131 |
| 132 OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner; | 132 OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace WebCore | 135 } // namespace WebCore |
| 136 | 136 |
| 137 #endif // Notification_h | 137 #endif // Notification_h |
| OLD | NEW |