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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 740543003: Remove the old Web Notification code-path (Chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unittest references 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: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index b1b2eb400d02fcd5a9e24badf3656c56998cdefb..bd4f385c5f0209c3689af30fcc757656c10d046d 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -37,7 +37,6 @@
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/transition_request_manager.h"
#include "content/common/accessibility_messages.h"
-#include "content/common/desktop_notification_messages.h"
#include "content/common/frame_messages.h"
#include "content/common/input_messages.h"
#include "content/common/inter_process_time_ticks_converter.h"
@@ -83,54 +82,6 @@ typedef base::hash_map<RenderFrameHostID, RenderFrameHostImpl*>
base::LazyInstance<RoutingIDFrameMap> g_routing_id_frame_map =
LAZY_INSTANCE_INITIALIZER;
-class DesktopNotificationDelegateImpl : public DesktopNotificationDelegate {
- public:
- DesktopNotificationDelegateImpl(RenderFrameHost* render_frame_host,
- int notification_id)
- : render_process_id_(render_frame_host->GetProcess()->GetID()),
- render_frame_id_(render_frame_host->GetRoutingID()),
- notification_id_(notification_id) {}
-
- ~DesktopNotificationDelegateImpl() override {}
-
- void NotificationDisplayed() override {
- RenderFrameHost* rfh =
- RenderFrameHost::FromID(render_process_id_, render_frame_id_);
- if (!rfh)
- return;
-
- rfh->Send(new DesktopNotificationMsg_PostDisplay(
- rfh->GetRoutingID(), notification_id_));
- }
-
- void NotificationClosed(bool by_user) override {
- RenderFrameHost* rfh =
- RenderFrameHost::FromID(render_process_id_, render_frame_id_);
- if (!rfh)
- return;
-
- rfh->Send(new DesktopNotificationMsg_PostClose(
- rfh->GetRoutingID(), notification_id_, by_user));
- static_cast<RenderFrameHostImpl*>(rfh)->NotificationClosed(
- notification_id_);
- }
-
- void NotificationClick() override {
- RenderFrameHost* rfh =
- RenderFrameHost::FromID(render_process_id_, render_frame_id_);
- if (!rfh)
- return;
-
- rfh->Send(new DesktopNotificationMsg_PostClick(
- rfh->GetRoutingID(), notification_id_));
- }
-
- private:
- int render_process_id_;
- int render_frame_id_;
- int notification_id_;
-};
-
// Translate a WebKit text direction into a base::i18n one.
base::i18n::TextDirection WebTextDirectionToChromeTextDirection(
blink::WebTextDirection dir) {
@@ -384,10 +335,6 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
OnBeginNavigation)
IPC_MESSAGE_HANDLER(PlatformNotificationHostMsg_RequestPermission,
OnRequestPlatformNotificationPermission)
- IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show,
- OnShowDesktopNotification)
- IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Cancel,
- OnCancelDesktopNotification)
IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse,
OnTextSurroundingSelectionResponse)
IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents)
@@ -1017,31 +964,6 @@ void RenderFrameHostImpl::OnRequestPlatformNotificationPermission(
done_callback);
}
-void RenderFrameHostImpl::OnShowDesktopNotification(
- int notification_id,
- const ShowDesktopNotificationHostMsgParams& params) {
- scoped_ptr<DesktopNotificationDelegateImpl> delegate(
- new DesktopNotificationDelegateImpl(this, notification_id));
-
- base::Closure cancel_callback;
- GetContentClient()->browser()->ShowDesktopNotification(
- params,
- GetSiteInstance()->GetBrowserContext(),
- GetProcess()->GetID(),
- delegate.Pass(),
- &cancel_callback);
-
- cancel_notification_callbacks_[notification_id] = cancel_callback;
-}
-
-void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) {
- if (!cancel_notification_callbacks_.count(notification_id))
- return;
-
- cancel_notification_callbacks_[notification_id].Run();
- cancel_notification_callbacks_.erase(notification_id);
-}
-
void RenderFrameHostImpl::OnTextSurroundingSelectionResponse(
const base::string16& content,
size_t start_offset,
@@ -1453,10 +1375,6 @@ void RenderFrameHostImpl::JavaScriptDialogClosed(
render_view_host_->delegate_->RendererUnresponsive(render_view_host_);
}
-void RenderFrameHostImpl::NotificationClosed(int notification_id) {
- cancel_notification_callbacks_.erase(notification_id);
-}
-
// PlzNavigate
void RenderFrameHostImpl::CommitNavigation(
ResourceResponse* response,
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/renderer_host/render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698