| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 #include "ui/base/text/text_elider.h" | 83 #include "ui/base/text/text_elider.h" |
| 84 #include "ui/gfx/favicon_size.h" | 84 #include "ui/gfx/favicon_size.h" |
| 85 #include "webkit/glue/webmenuitem.h" | 85 #include "webkit/glue/webmenuitem.h" |
| 86 | 86 |
| 87 #ifdef FILE_MANAGER_EXTENSION | 87 #ifdef FILE_MANAGER_EXTENSION |
| 88 #include "chrome/browser/extensions/file_manager_util.h" | 88 #include "chrome/browser/extensions/file_manager_util.h" |
| 89 #endif | 89 #endif |
| 90 | 90 |
| 91 using content::ChildProcessSecurityPolicy; | 91 using content::ChildProcessSecurityPolicy; |
| 92 using content::DownloadManager; | 92 using content::DownloadManager; |
| 93 using content::NavigationController; |
| 93 using content::NavigationEntry; | 94 using content::NavigationEntry; |
| 94 using content::OpenURLParams; | 95 using content::OpenURLParams; |
| 95 using content::SSLStatus; | 96 using content::SSLStatus; |
| 96 using content::UserMetricsAction; | 97 using content::UserMetricsAction; |
| 97 using content::WebContents; | 98 using content::WebContents; |
| 98 using WebKit::WebContextMenuData; | 99 using WebKit::WebContextMenuData; |
| 99 using WebKit::WebMediaPlayerAction; | 100 using WebKit::WebMediaPlayerAction; |
| 100 using WebKit::WebPluginAction; | 101 using WebKit::WebPluginAction; |
| 101 using WebKit::WebURL; | 102 using WebKit::WebURL; |
| 102 using WebKit::WebString; | 103 using WebKit::WebString; |
| (...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 | 1672 |
| 1672 case IDC_VIEW_SOURCE: | 1673 case IDC_VIEW_SOURCE: |
| 1673 source_web_contents_->ViewSource(); | 1674 source_web_contents_->ViewSource(); |
| 1674 break; | 1675 break; |
| 1675 | 1676 |
| 1676 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: | 1677 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: |
| 1677 Inspect(params_.x, params_.y); | 1678 Inspect(params_.x, params_.y); |
| 1678 break; | 1679 break; |
| 1679 | 1680 |
| 1680 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { | 1681 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { |
| 1681 NavigationEntry* nav_entry = | 1682 NavigationController* controller = &source_web_contents_->GetController(); |
| 1682 source_web_contents_->GetController().GetActiveEntry(); | 1683 NavigationEntry* nav_entry = controller->GetActiveEntry(); |
| 1683 source_web_contents_->ShowPageInfo(nav_entry->GetURL(), | 1684 Browser* browser = Browser::GetBrowserForController(controller, NULL);
|
| 1684 nav_entry->GetSSL(), true); | 1685 browser->ShowPageInfo(nav_entry->GetURL(), nav_entry->GetSSL(), true); |
| 1685 break; | 1686 break; |
| 1686 } | 1687 } |
| 1687 | 1688 |
| 1688 case IDC_CONTENT_CONTEXT_TRANSLATE: { | 1689 case IDC_CONTENT_CONTEXT_TRANSLATE: { |
| 1689 // A translation might have been triggered by the time the menu got | 1690 // A translation might have been triggered by the time the menu got |
| 1690 // selected, do nothing in that case. | 1691 // selected, do nothing in that case. |
| 1691 TabContentsWrapper* tab_contents_wrapper = | 1692 TabContentsWrapper* tab_contents_wrapper = |
| 1692 TabContentsWrapper::GetCurrentWrapperForContents( | 1693 TabContentsWrapper::GetCurrentWrapperForContents( |
| 1693 source_web_contents_); | 1694 source_web_contents_); |
| 1694 if (!tab_contents_wrapper) | 1695 if (!tab_contents_wrapper) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1714 case IDC_CONTENT_CONTEXT_RELOADFRAME: | 1715 case IDC_CONTENT_CONTEXT_RELOADFRAME: |
| 1715 rvh->ReloadFrame(); | 1716 rvh->ReloadFrame(); |
| 1716 break; | 1717 break; |
| 1717 | 1718 |
| 1718 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: | 1719 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: |
| 1719 source_web_contents_->ViewFrameSource(params_.frame_url, | 1720 source_web_contents_->ViewFrameSource(params_.frame_url, |
| 1720 params_.frame_content_state); | 1721 params_.frame_content_state); |
| 1721 break; | 1722 break; |
| 1722 | 1723 |
| 1723 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: { | 1724 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: { |
| 1724 source_web_contents_->ShowPageInfo(params_.frame_url, | 1725 Browser* browser = Browser::GetBrowserForController( |
| 1725 params_.security_info, | 1726 &source_web_contents_->GetController(), NULL); |
| 1726 false); // Don't show the history. | 1727 browser->ShowPageInfo(params_.frame_url, params_.security_info, false); |
| 1727 break; | 1728 break; |
| 1728 } | 1729 } |
| 1729 | 1730 |
| 1730 case IDC_CONTENT_CONTEXT_UNDO: | 1731 case IDC_CONTENT_CONTEXT_UNDO: |
| 1731 rvh->Undo(); | 1732 rvh->Undo(); |
| 1732 break; | 1733 break; |
| 1733 | 1734 |
| 1734 case IDC_CONTENT_CONTEXT_REDO: | 1735 case IDC_CONTENT_CONTEXT_REDO: |
| 1735 rvh->Redo(); | 1736 rvh->Redo(); |
| 1736 break; | 1737 break; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 source_web_contents_->GetRenderViewHost()-> | 1986 source_web_contents_->GetRenderViewHost()-> |
| 1986 ExecuteMediaPlayerActionAtLocation(location, action); | 1987 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1987 } | 1988 } |
| 1988 | 1989 |
| 1989 void RenderViewContextMenu::PluginActionAt( | 1990 void RenderViewContextMenu::PluginActionAt( |
| 1990 const gfx::Point& location, | 1991 const gfx::Point& location, |
| 1991 const WebPluginAction& action) { | 1992 const WebPluginAction& action) { |
| 1992 source_web_contents_->GetRenderViewHost()-> | 1993 source_web_contents_->GetRenderViewHost()-> |
| 1993 ExecutePluginActionAtLocation(location, action); | 1994 ExecutePluginActionAtLocation(location, action); |
| 1994 } | 1995 } |
| OLD | NEW |