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

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

Issue 15232002: Make remaining modules/ objects ScriptWrappable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/notifications/NotificationCenter.h ('k') | Source/modules/quota/StorageInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 { 46 {
47 RefPtr<NotificationCenter> notificationCenter(adoptRef(new NotificationCente r(context, client))); 47 RefPtr<NotificationCenter> notificationCenter(adoptRef(new NotificationCente r(context, client)));
48 notificationCenter->suspendIfNeeded(); 48 notificationCenter->suspendIfNeeded();
49 return notificationCenter.release(); 49 return notificationCenter.release();
50 } 50 }
51 51
52 NotificationCenter::NotificationCenter(ScriptExecutionContext* context, Notifica tionClient* client) 52 NotificationCenter::NotificationCenter(ScriptExecutionContext* context, Notifica tionClient* client)
53 : ActiveDOMObject(context) 53 : ActiveDOMObject(context)
54 , m_client(client) 54 , m_client(client)
55 { 55 {
56 ScriptWrappable::init(this);
56 } 57 }
57 58
58 #if ENABLE(LEGACY_NOTIFICATIONS) 59 #if ENABLE(LEGACY_NOTIFICATIONS)
59 int NotificationCenter::checkPermission() 60 int NotificationCenter::checkPermission()
60 { 61 {
61 if (!client() || !scriptExecutionContext()) 62 if (!client() || !scriptExecutionContext())
62 return NotificationClient::PermissionDenied; 63 return NotificationClient::PermissionDenied;
63 64
64 switch (scriptExecutionContext()->securityOrigin()->canShowNotifications()) { 65 switch (scriptExecutionContext()->securityOrigin()->canShowNotifications()) {
65 case SecurityOrigin::AlwaysAllow: 66 case SecurityOrigin::AlwaysAllow:
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void NotificationCenter::NotificationRequestCallback::timerFired(Timer<Notificat ionCenter::NotificationRequestCallback>*) 133 void NotificationCenter::NotificationRequestCallback::timerFired(Timer<Notificat ionCenter::NotificationRequestCallback>*)
133 { 134 {
134 if (m_callback) 135 if (m_callback)
135 m_callback->handleEvent(); 136 m_callback->handleEvent();
136 m_notificationCenter->requestTimedOut(this); 137 m_notificationCenter->requestTimedOut(this);
137 } 138 }
138 139
139 } // namespace WebCore 140 } // namespace WebCore
140 141
141 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 142 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
OLDNEW
« no previous file with comments | « Source/modules/notifications/NotificationCenter.h ('k') | Source/modules/quota/StorageInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698