OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN, | 1690 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN, |
1691 content::Source<RenderViewContextMenu>(this), | 1691 content::Source<RenderViewContextMenu>(this), |
1692 content::NotificationService::NoDetails()); | 1692 content::NotificationService::NoDetails()); |
1693 } | 1693 } |
1694 | 1694 |
1695 void RenderViewContextMenu::NotifyURLOpened( | 1695 void RenderViewContextMenu::NotifyURLOpened( |
1696 const GURL& url, | 1696 const GURL& url, |
1697 content::WebContents* new_contents) { | 1697 content::WebContents* new_contents) { |
1698 RetargetingDetails details; | 1698 RetargetingDetails details; |
1699 details.source_web_contents = source_web_contents_; | 1699 details.source_web_contents = source_web_contents_; |
1700 details.source_render_frame_id = GetRenderFrameHost()->GetRoutingID(); | 1700 // Don't use GetRenderFrameHost() as it may be NULL. crbug.com/399789 |
| 1701 details.source_render_frame_id = render_frame_id_; |
1701 details.target_url = url; | 1702 details.target_url = url; |
1702 details.target_web_contents = new_contents; | 1703 details.target_web_contents = new_contents; |
1703 details.not_yet_in_tabstrip = false; | 1704 details.not_yet_in_tabstrip = false; |
1704 | 1705 |
1705 content::NotificationService::current()->Notify( | 1706 content::NotificationService::current()->Notify( |
1706 chrome::NOTIFICATION_RETARGETING, | 1707 chrome::NOTIFICATION_RETARGETING, |
1707 content::Source<Profile>(GetProfile()), | 1708 content::Source<Profile>(GetProfile()), |
1708 content::Details<RetargetingDetails>(&details)); | 1709 content::Details<RetargetingDetails>(&details)); |
1709 } | 1710 } |
1710 | 1711 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 source_web_contents_->GetRenderViewHost()-> | 1772 source_web_contents_->GetRenderViewHost()-> |
1772 ExecuteMediaPlayerActionAtLocation(location, action); | 1773 ExecuteMediaPlayerActionAtLocation(location, action); |
1773 } | 1774 } |
1774 | 1775 |
1775 void RenderViewContextMenu::PluginActionAt( | 1776 void RenderViewContextMenu::PluginActionAt( |
1776 const gfx::Point& location, | 1777 const gfx::Point& location, |
1777 const WebPluginAction& action) { | 1778 const WebPluginAction& action) { |
1778 source_web_contents_->GetRenderViewHost()-> | 1779 source_web_contents_->GetRenderViewHost()-> |
1779 ExecutePluginActionAtLocation(location, action); | 1780 ExecutePluginActionAtLocation(location, action); |
1780 } | 1781 } |
OLD | NEW |