| OLD | NEW |
| 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 | 941 |
| 942 void RenderFrameHostImpl::OnShowDesktopNotification( | 942 void RenderFrameHostImpl::OnShowDesktopNotification( |
| 943 int notification_id, | 943 int notification_id, |
| 944 const ShowDesktopNotificationHostMsgParams& params) { | 944 const ShowDesktopNotificationHostMsgParams& params) { |
| 945 scoped_ptr<DesktopNotificationDelegateImpl> delegate( | 945 scoped_ptr<DesktopNotificationDelegateImpl> delegate( |
| 946 new DesktopNotificationDelegateImpl(this, notification_id)); | 946 new DesktopNotificationDelegateImpl(this, notification_id)); |
| 947 | 947 |
| 948 base::Closure cancel_callback; | 948 base::Closure cancel_callback; |
| 949 GetContentClient()->browser()->ShowDesktopNotification( | 949 GetContentClient()->browser()->ShowDesktopNotification( |
| 950 params, | 950 params, |
| 951 this, | 951 GetSiteInstance()->GetBrowserContext(), |
| 952 delegate.PassAs<DesktopNotificationDelegate>(), | 952 delegate.PassAs<DesktopNotificationDelegate>(), |
| 953 &cancel_callback); | 953 &cancel_callback); |
| 954 cancel_notification_callbacks_[notification_id] = cancel_callback; | 954 cancel_notification_callbacks_[notification_id] = cancel_callback; |
| 955 } | 955 } |
| 956 | 956 |
| 957 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) { | 957 void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) { |
| 958 if (!cancel_notification_callbacks_.count(notification_id)) { | 958 if (!cancel_notification_callbacks_.count(notification_id)) { |
| 959 NOTREACHED(); | 959 NOTREACHED(); |
| 960 return; | 960 return; |
| 961 } | 961 } |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 // Clear any state if a pending navigation is canceled or preempted. | 1453 // Clear any state if a pending navigation is canceled or preempted. |
| 1454 if (suspended_nav_params_) | 1454 if (suspended_nav_params_) |
| 1455 suspended_nav_params_.reset(); | 1455 suspended_nav_params_.reset(); |
| 1456 | 1456 |
| 1457 TRACE_EVENT_ASYNC_END0("navigation", | 1457 TRACE_EVENT_ASYNC_END0("navigation", |
| 1458 "RenderFrameHostImpl navigation suspended", this); | 1458 "RenderFrameHostImpl navigation suspended", this); |
| 1459 navigations_suspended_ = false; | 1459 navigations_suspended_ = false; |
| 1460 } | 1460 } |
| 1461 | 1461 |
| 1462 } // namespace content | 1462 } // namespace content |
| OLD | NEW |