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

Unified Diff: Source/modules/push_messaging/PushPermissionCallback.cpp

Issue 702003004: Rename PushPermissionCallback to PushPermissionStatusCallback [1/3] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/push_messaging/PushPermissionCallback.cpp
diff --git a/Source/modules/push_messaging/PushPermissionCallback.cpp b/Source/modules/push_messaging/PushPermissionCallback.cpp
deleted file mode 100644
index ed4bebc04c0cebfa1473fb34485ff77783e2ce24..0000000000000000000000000000000000000000
--- a/Source/modules/push_messaging/PushPermissionCallback.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "modules/push_messaging/PushPermissionCallback.h"
-
-#include "bindings/core/v8/ScriptPromiseResolver.h"
-#include "core/dom/ExceptionCode.h"
-#include "wtf/text/WTFString.h"
-
-namespace blink {
-
-PushPermissionCallback::PushPermissionCallback(PassRefPtr<ScriptPromiseResolver> resolver)
- : m_resolver(resolver)
-{
-}
-
-PushPermissionCallback::~PushPermissionCallback()
-{
-}
-
-void PushPermissionCallback::onSuccess(WebPushPermissionStatus* status)
-{
- m_resolver->resolve(permissionString(*status));
-}
-
-void PushPermissionCallback::onError()
-{
- m_resolver->reject();
-}
-
-// static
-const String& PushPermissionCallback::permissionString(WebPushPermissionStatus status)
-{
- DEFINE_STATIC_LOCAL(const String, grantedPermission, ("granted"));
- DEFINE_STATIC_LOCAL(const String, deniedPermission, ("denied"));
- DEFINE_STATIC_LOCAL(const String, defaultPermission, ("default"));
-
- switch (status) {
- case WebPushPermissionStatusGranted:
- return grantedPermission;
- case WebPushPermissionStatusDenied:
- return deniedPermission;
- case WebPushPermissionStatusDefault:
- return defaultPermission;
- }
-
- ASSERT_NOT_REACHED();
- return deniedPermission;
-}
-
-} // namespace blink
« no previous file with comments | « Source/modules/push_messaging/PushPermissionCallback.h ('k') | Source/modules/push_messaging/PushPermissionStatusCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698