Commit 0f874ace authored by Anita Woodruff's avatar Anita Woodruff Committed by Commit Bot

[Notifications] Rename GetNotificationManager() in Notification.cpp

- This method returns a WebNotificationManager so updated the
method to reflect this.

- This avoids confusion with the NotificationManager (a subclass of
WebNotificationManager living outside of blink).

Bug: 
Change-Id: Id9d1746d31cafa7ee68bfdd5b996c625b6834057
Reviewed-on: https://chromium-review.googlesource.com/775198Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Anita Woodruff <awdf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517857}
parent d5bfc97f
......@@ -1380,7 +1380,7 @@ RendererBlinkPlatformImpl::CreateTrialTokenValidator() {
//------------------------------------------------------------------------------
blink::WebNotificationManager*
RendererBlinkPlatformImpl::GetNotificationManager() {
RendererBlinkPlatformImpl::GetWebNotificationManager() {
if (!thread_safe_sender_.get() || !notification_dispatcher_.get())
return nullptr;
......
......@@ -217,7 +217,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
blink::WebPushProvider* PushProvider() override;
std::unique_ptr<blink::WebTrialTokenValidator> CreateTrialTokenValidator()
override;
blink::WebNotificationManager* GetNotificationManager() override;
blink::WebNotificationManager* GetWebNotificationManager() override;
void DidStartWorkerThread() override;
void WillStopWorkerThread() override;
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
......
......@@ -65,8 +65,8 @@
namespace blink {
namespace {
WebNotificationManager* GetNotificationManager() {
return Platform::Current()->GetNotificationManager();
WebNotificationManager* GetWebNotificationManager() {
return Platform::Current()->GetWebNotificationManager();
}
} // namespace
......@@ -151,7 +151,7 @@ Notification::Notification(ExecutionContext* context,
type_(type),
state_(State::kLoading),
data_(data) {
DCHECK(GetNotificationManager());
DCHECK(GetWebNotificationManager());
}
Notification::~Notification() {}
......@@ -190,8 +190,8 @@ void Notification::DidLoadResources(NotificationResourcesLoader* loader) {
SecurityOrigin* origin = GetExecutionContext()->GetSecurityOrigin();
DCHECK(origin);
GetNotificationManager()->Show(WebSecurityOrigin(origin), data_,
loader->GetResources(), this);
GetWebNotificationManager()->Show(WebSecurityOrigin(origin), data_,
loader->GetResources(), this);
loader_.Clear();
state_ = State::kShowing;
......@@ -210,7 +210,7 @@ void Notification::close() {
WrapPersistent(this)));
state_ = State::kClosing;
GetNotificationManager()->Close(this);
GetWebNotificationManager()->Close(this);
return;
}
......@@ -219,8 +219,8 @@ void Notification::close() {
SecurityOrigin* origin = GetExecutionContext()->GetSecurityOrigin();
DCHECK(origin);
GetNotificationManager()->ClosePersistent(WebSecurityOrigin(origin),
data_.tag, notification_id_);
GetWebNotificationManager()->ClosePersistent(WebSecurityOrigin(origin),
data_.tag, notification_id_);
}
void Notification::DispatchShowEvent() {
......@@ -444,7 +444,7 @@ const AtomicString& Notification::InterfaceName() const {
}
void Notification::ContextDestroyed(ExecutionContext*) {
GetNotificationManager()->NotifyDelegateDestroyed(this);
GetWebNotificationManager()->NotifyDelegateDestroyed(this);
state_ = State::kClosed;
......
......@@ -126,7 +126,7 @@ ScriptPromise ServiceWorkerRegistrationNotifications::getNotifications(
resolver);
WebNotificationManager* notification_manager =
Platform::Current()->GetNotificationManager();
Platform::Current()->GetWebNotificationManager();
DCHECK(notification_manager);
notification_manager->GetNotifications(
......@@ -188,7 +188,7 @@ void ServiceWorkerRegistrationNotifications::DidLoadResources(
DCHECK(loaders_.Contains(loader));
WebNotificationManager* notification_manager =
Platform::Current()->GetNotificationManager();
Platform::Current()->GetWebNotificationManager();
DCHECK(notification_manager);
notification_manager->ShowPersistent(
......
......@@ -691,7 +691,9 @@ class BLINK_PLATFORM_EXPORT Platform {
// Web Notifications --------------------------------------------------
virtual WebNotificationManager* GetNotificationManager() { return nullptr; }
virtual WebNotificationManager* GetWebNotificationManager() {
return nullptr;
}
// Push API------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment