OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <set> | 6 #include <set> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
10 | 10 |
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 source_web_contents_->ViewSource(); | 1713 source_web_contents_->ViewSource(); |
1714 break; | 1714 break; |
1715 | 1715 |
1716 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: | 1716 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: |
1717 Inspect(params_.x, params_.y); | 1717 Inspect(params_.x, params_.y); |
1718 break; | 1718 break; |
1719 | 1719 |
1720 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { | 1720 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { |
1721 NavigationController* controller = &source_web_contents_->GetController(); | 1721 NavigationController* controller = &source_web_contents_->GetController(); |
1722 NavigationEntry* nav_entry = controller->GetActiveEntry(); | 1722 NavigationEntry* nav_entry = controller->GetActiveEntry(); |
1723 Browser* browser = browser::FindBrowserForController(controller, NULL); | 1723 Browser* browser = |
| 1724 browser::FindBrowserWithWebContents(source_web_contents_); |
1724 chrome::ShowPageInfo(browser, source_web_contents_, nav_entry->GetURL(), | 1725 chrome::ShowPageInfo(browser, source_web_contents_, nav_entry->GetURL(), |
1725 nav_entry->GetSSL(), true); | 1726 nav_entry->GetSSL(), true); |
1726 break; | 1727 break; |
1727 } | 1728 } |
1728 | 1729 |
1729 case IDC_CONTENT_CONTEXT_TRANSLATE: { | 1730 case IDC_CONTENT_CONTEXT_TRANSLATE: { |
1730 // A translation might have been triggered by the time the menu got | 1731 // A translation might have been triggered by the time the menu got |
1731 // selected, do nothing in that case. | 1732 // selected, do nothing in that case. |
1732 TabContents* tab_contents = | 1733 TabContents* tab_contents = |
1733 TabContents::FromWebContents(source_web_contents_); | 1734 TabContents::FromWebContents(source_web_contents_); |
(...skipping 20 matching lines...) Expand all Loading... |
1754 case IDC_CONTENT_CONTEXT_RELOADFRAME: | 1755 case IDC_CONTENT_CONTEXT_RELOADFRAME: |
1755 rvh->ReloadFrame(); | 1756 rvh->ReloadFrame(); |
1756 break; | 1757 break; |
1757 | 1758 |
1758 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: | 1759 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: |
1759 source_web_contents_->ViewFrameSource(params_.frame_url, | 1760 source_web_contents_->ViewFrameSource(params_.frame_url, |
1760 params_.frame_content_state); | 1761 params_.frame_content_state); |
1761 break; | 1762 break; |
1762 | 1763 |
1763 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: { | 1764 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: { |
1764 Browser* browser = browser::FindBrowserForController( | 1765 Browser* browser = browser::FindBrowserWithWebContents( |
1765 &source_web_contents_->GetController(), NULL); | 1766 source_web_contents_); |
1766 chrome::ShowPageInfo(browser, source_web_contents_, params_.frame_url, | 1767 chrome::ShowPageInfo(browser, source_web_contents_, params_.frame_url, |
1767 params_.security_info, false); | 1768 params_.security_info, false); |
1768 break; | 1769 break; |
1769 } | 1770 } |
1770 | 1771 |
1771 case IDC_CONTENT_CONTEXT_UNDO: | 1772 case IDC_CONTENT_CONTEXT_UNDO: |
1772 rvh->Undo(); | 1773 rvh->Undo(); |
1773 break; | 1774 break; |
1774 | 1775 |
1775 case IDC_CONTENT_CONTEXT_REDO: | 1776 case IDC_CONTENT_CONTEXT_REDO: |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 source_web_contents_->GetRenderViewHost()-> | 2009 source_web_contents_->GetRenderViewHost()-> |
2009 ExecuteMediaPlayerActionAtLocation(location, action); | 2010 ExecuteMediaPlayerActionAtLocation(location, action); |
2010 } | 2011 } |
2011 | 2012 |
2012 void RenderViewContextMenu::PluginActionAt( | 2013 void RenderViewContextMenu::PluginActionAt( |
2013 const gfx::Point& location, | 2014 const gfx::Point& location, |
2014 const WebPluginAction& action) { | 2015 const WebPluginAction& action) { |
2015 source_web_contents_->GetRenderViewHost()-> | 2016 source_web_contents_->GetRenderViewHost()-> |
2016 ExecutePluginActionAtLocation(location, action); | 2017 ExecutePluginActionAtLocation(location, action); |
2017 } | 2018 } |
OLD | NEW |