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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 class DesktopNotificationDelegateImpl : public DesktopNotificationDelegate { | 78 class DesktopNotificationDelegateImpl : public DesktopNotificationDelegate { |
79 public: | 79 public: |
80 DesktopNotificationDelegateImpl(RenderFrameHost* render_frame_host, | 80 DesktopNotificationDelegateImpl(RenderFrameHost* render_frame_host, |
81 int notification_id) | 81 int notification_id) |
82 : render_process_id_(render_frame_host->GetProcess()->GetID()), | 82 : render_process_id_(render_frame_host->GetProcess()->GetID()), |
83 render_frame_id_(render_frame_host->GetRoutingID()), | 83 render_frame_id_(render_frame_host->GetRoutingID()), |
84 notification_id_(notification_id) {} | 84 notification_id_(notification_id) {} |
85 | 85 |
86 virtual ~DesktopNotificationDelegateImpl() {} | 86 virtual ~DesktopNotificationDelegateImpl() {} |
87 | 87 |
88 virtual void NotificationDisplayed() OVERRIDE { | 88 virtual void NotificationDisplayed() override { |
89 RenderFrameHost* rfh = | 89 RenderFrameHost* rfh = |
90 RenderFrameHost::FromID(render_process_id_, render_frame_id_); | 90 RenderFrameHost::FromID(render_process_id_, render_frame_id_); |
91 if (!rfh) | 91 if (!rfh) |
92 return; | 92 return; |
93 | 93 |
94 rfh->Send(new DesktopNotificationMsg_PostDisplay( | 94 rfh->Send(new DesktopNotificationMsg_PostDisplay( |
95 rfh->GetRoutingID(), notification_id_)); | 95 rfh->GetRoutingID(), notification_id_)); |
96 } | 96 } |
97 | 97 |
98 virtual void NotificationError() OVERRIDE { | 98 virtual void NotificationError() override { |
99 RenderFrameHost* rfh = | 99 RenderFrameHost* rfh = |
100 RenderFrameHost::FromID(render_process_id_, render_frame_id_); | 100 RenderFrameHost::FromID(render_process_id_, render_frame_id_); |
101 if (!rfh) | 101 if (!rfh) |
102 return; | 102 return; |
103 | 103 |
104 rfh->Send(new DesktopNotificationMsg_PostError( | 104 rfh->Send(new DesktopNotificationMsg_PostError( |
105 rfh->GetRoutingID(), notification_id_)); | 105 rfh->GetRoutingID(), notification_id_)); |
106 } | 106 } |
107 | 107 |
108 virtual void NotificationClosed(bool by_user) OVERRIDE { | 108 virtual void NotificationClosed(bool by_user) override { |
109 RenderFrameHost* rfh = | 109 RenderFrameHost* rfh = |
110 RenderFrameHost::FromID(render_process_id_, render_frame_id_); | 110 RenderFrameHost::FromID(render_process_id_, render_frame_id_); |
111 if (!rfh) | 111 if (!rfh) |
112 return; | 112 return; |
113 | 113 |
114 rfh->Send(new DesktopNotificationMsg_PostClose( | 114 rfh->Send(new DesktopNotificationMsg_PostClose( |
115 rfh->GetRoutingID(), notification_id_, by_user)); | 115 rfh->GetRoutingID(), notification_id_, by_user)); |
116 static_cast<RenderFrameHostImpl*>(rfh)->NotificationClosed( | 116 static_cast<RenderFrameHostImpl*>(rfh)->NotificationClosed( |
117 notification_id_); | 117 notification_id_); |
118 } | 118 } |
119 | 119 |
120 virtual void NotificationClick() OVERRIDE { | 120 virtual void NotificationClick() override { |
121 RenderFrameHost* rfh = | 121 RenderFrameHost* rfh = |
122 RenderFrameHost::FromID(render_process_id_, render_frame_id_); | 122 RenderFrameHost::FromID(render_process_id_, render_frame_id_); |
123 if (!rfh) | 123 if (!rfh) |
124 return; | 124 return; |
125 | 125 |
126 rfh->Send(new DesktopNotificationMsg_PostClick( | 126 rfh->Send(new DesktopNotificationMsg_PostClick( |
127 rfh->GetRoutingID(), notification_id_)); | 127 rfh->GetRoutingID(), notification_id_)); |
128 } | 128 } |
129 | 129 |
130 private: | 130 private: |
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 // Clear any state if a pending navigation is canceled or preempted. | 1541 // Clear any state if a pending navigation is canceled or preempted. |
1542 if (suspended_nav_params_) | 1542 if (suspended_nav_params_) |
1543 suspended_nav_params_.reset(); | 1543 suspended_nav_params_.reset(); |
1544 | 1544 |
1545 TRACE_EVENT_ASYNC_END0("navigation", | 1545 TRACE_EVENT_ASYNC_END0("navigation", |
1546 "RenderFrameHostImpl navigation suspended", this); | 1546 "RenderFrameHostImpl navigation suspended", this); |
1547 navigations_suspended_ = false; | 1547 navigations_suspended_ = false; |
1548 } | 1548 } |
1549 | 1549 |
1550 } // namespace content | 1550 } // namespace content |
OLD | NEW |