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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 578883003: Remove the strict dependency on WebContents for Web Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: plumb through render_process_id 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 } 1005 }
1006 1006
1007 void RenderFrameHostImpl::OnShowDesktopNotification( 1007 void RenderFrameHostImpl::OnShowDesktopNotification(
1008 int notification_id, 1008 int notification_id,
1009 const ShowDesktopNotificationHostMsgParams& params) { 1009 const ShowDesktopNotificationHostMsgParams& params) {
1010 scoped_ptr<DesktopNotificationDelegateImpl> delegate( 1010 scoped_ptr<DesktopNotificationDelegateImpl> delegate(
1011 new DesktopNotificationDelegateImpl(this, notification_id)); 1011 new DesktopNotificationDelegateImpl(this, notification_id));
1012 1012
1013 base::Closure cancel_callback; 1013 base::Closure cancel_callback;
1014 GetContentClient()->browser()->ShowDesktopNotification( 1014 GetContentClient()->browser()->ShowDesktopNotification(
1015 params, this, delegate.Pass(), &cancel_callback); 1015 params,
1016 GetSiteInstance()->GetBrowserContext(),
1017 GetProcess()->GetID(),
1018 delegate.Pass(),
1019 &cancel_callback);
1020
1016 cancel_notification_callbacks_[notification_id] = cancel_callback; 1021 cancel_notification_callbacks_[notification_id] = cancel_callback;
1017 } 1022 }
1018 1023
1019 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) { 1024 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) {
1020 if (!cancel_notification_callbacks_.count(notification_id)) { 1025 if (!cancel_notification_callbacks_.count(notification_id)) {
1021 NOTREACHED(); 1026 NOTREACHED();
1022 return; 1027 return;
1023 } 1028 }
1024 cancel_notification_callbacks_[notification_id].Run(); 1029 cancel_notification_callbacks_[notification_id].Run();
1025 cancel_notification_callbacks_.erase(notification_id); 1030 cancel_notification_callbacks_.erase(notification_id);
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 // Clear any state if a pending navigation is canceled or preempted. 1569 // Clear any state if a pending navigation is canceled or preempted.
1565 if (suspended_nav_params_) 1570 if (suspended_nav_params_)
1566 suspended_nav_params_.reset(); 1571 suspended_nav_params_.reset();
1567 1572
1568 TRACE_EVENT_ASYNC_END0("navigation", 1573 TRACE_EVENT_ASYNC_END0("navigation",
1569 "RenderFrameHostImpl navigation suspended", this); 1574 "RenderFrameHostImpl navigation suspended", this);
1570 navigations_suspended_ = false; 1575 navigations_suspended_ = false;
1571 } 1576 }
1572 1577
1573 } // namespace content 1578 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_object_proxy.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698