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 29 matching lines...) Expand all Loading... |
40 #include "chrome/browser/search_engines/template_url_service_factory.h" | 40 #include "chrome/browser/search_engines/template_url_service_factory.h" |
41 #include "chrome/browser/spellchecker/spellcheck_host.h" | 41 #include "chrome/browser/spellchecker/spellcheck_host.h" |
42 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 42 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
43 #include "chrome/browser/tab_contents/retargeting_details.h" | 43 #include "chrome/browser/tab_contents/retargeting_details.h" |
44 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" | 44 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
45 #include "chrome/browser/tab_contents/spelling_menu_observer.h" | 45 #include "chrome/browser/tab_contents/spelling_menu_observer.h" |
46 #include "chrome/browser/translate/translate_manager.h" | 46 #include "chrome/browser/translate/translate_manager.h" |
47 #include "chrome/browser/translate/translate_prefs.h" | 47 #include "chrome/browser/translate/translate_prefs.h" |
48 #include "chrome/browser/translate/translate_tab_helper.h" | 48 #include "chrome/browser/translate/translate_tab_helper.h" |
49 #include "chrome/browser/ui/browser.h" | 49 #include "chrome/browser/ui/browser.h" |
| 50 #include "chrome/browser/ui/browser_finder.h" |
50 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 51 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
51 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 52 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
52 #include "chrome/common/chrome_constants.h" | 53 #include "chrome/common/chrome_constants.h" |
53 #include "chrome/common/chrome_notification_types.h" | 54 #include "chrome/common/chrome_notification_types.h" |
54 #include "chrome/common/chrome_switches.h" | 55 #include "chrome/common/chrome_switches.h" |
55 #include "chrome/common/chrome_view_type.h" | 56 #include "chrome/common/chrome_view_type.h" |
56 #include "chrome/common/extensions/extension.h" | 57 #include "chrome/common/extensions/extension.h" |
57 #include "chrome/common/net/url_util.h" | 58 #include "chrome/common/net/url_util.h" |
58 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
59 #include "chrome/common/print_messages.h" | 60 #include "chrome/common/print_messages.h" |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 source_web_contents_->ViewSource(); | 1684 source_web_contents_->ViewSource(); |
1684 break; | 1685 break; |
1685 | 1686 |
1686 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: | 1687 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: |
1687 Inspect(params_.x, params_.y); | 1688 Inspect(params_.x, params_.y); |
1688 break; | 1689 break; |
1689 | 1690 |
1690 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { | 1691 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { |
1691 NavigationController* controller = &source_web_contents_->GetController(); | 1692 NavigationController* controller = &source_web_contents_->GetController(); |
1692 NavigationEntry* nav_entry = controller->GetActiveEntry(); | 1693 NavigationEntry* nav_entry = controller->GetActiveEntry(); |
1693 Browser* browser = Browser::GetBrowserForController(controller, NULL); | 1694 Browser* browser = browser::FindBrowserForController(controller, NULL); |
1694 browser->ShowPageInfo(source_web_contents_, nav_entry->GetURL(), | 1695 browser->ShowPageInfo(source_web_contents_, nav_entry->GetURL(), |
1695 nav_entry->GetSSL(), true); | 1696 nav_entry->GetSSL(), true); |
1696 break; | 1697 break; |
1697 } | 1698 } |
1698 | 1699 |
1699 case IDC_CONTENT_CONTEXT_TRANSLATE: { | 1700 case IDC_CONTENT_CONTEXT_TRANSLATE: { |
1700 // A translation might have been triggered by the time the menu got | 1701 // A translation might have been triggered by the time the menu got |
1701 // selected, do nothing in that case. | 1702 // selected, do nothing in that case. |
1702 TabContentsWrapper* tab_contents_wrapper = | 1703 TabContentsWrapper* tab_contents_wrapper = |
1703 TabContentsWrapper::GetCurrentWrapperForContents( | 1704 TabContentsWrapper::GetCurrentWrapperForContents( |
(...skipping 21 matching lines...) Expand all Loading... |
1725 case IDC_CONTENT_CONTEXT_RELOADFRAME: | 1726 case IDC_CONTENT_CONTEXT_RELOADFRAME: |
1726 rvh->ReloadFrame(); | 1727 rvh->ReloadFrame(); |
1727 break; | 1728 break; |
1728 | 1729 |
1729 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: | 1730 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: |
1730 source_web_contents_->ViewFrameSource(params_.frame_url, | 1731 source_web_contents_->ViewFrameSource(params_.frame_url, |
1731 params_.frame_content_state); | 1732 params_.frame_content_state); |
1732 break; | 1733 break; |
1733 | 1734 |
1734 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: { | 1735 case IDC_CONTENT_CONTEXT_VIEWFRAMEINFO: { |
1735 Browser* browser = Browser::GetBrowserForController( | 1736 Browser* browser = browser::FindBrowserForController( |
1736 &source_web_contents_->GetController(), NULL); | 1737 &source_web_contents_->GetController(), NULL); |
1737 browser->ShowPageInfo(source_web_contents_, params_.frame_url, | 1738 browser->ShowPageInfo(source_web_contents_, params_.frame_url, |
1738 params_.security_info, false); | 1739 params_.security_info, false); |
1739 break; | 1740 break; |
1740 } | 1741 } |
1741 | 1742 |
1742 case IDC_CONTENT_CONTEXT_UNDO: | 1743 case IDC_CONTENT_CONTEXT_UNDO: |
1743 rvh->Undo(); | 1744 rvh->Undo(); |
1744 break; | 1745 break; |
1745 | 1746 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1983 source_web_contents_->GetRenderViewHost()-> | 1984 source_web_contents_->GetRenderViewHost()-> |
1984 ExecuteMediaPlayerActionAtLocation(location, action); | 1985 ExecuteMediaPlayerActionAtLocation(location, action); |
1985 } | 1986 } |
1986 | 1987 |
1987 void RenderViewContextMenu::PluginActionAt( | 1988 void RenderViewContextMenu::PluginActionAt( |
1988 const gfx::Point& location, | 1989 const gfx::Point& location, |
1989 const WebPluginAction& action) { | 1990 const WebPluginAction& action) { |
1990 source_web_contents_->GetRenderViewHost()-> | 1991 source_web_contents_->GetRenderViewHost()-> |
1991 ExecutePluginActionAtLocation(location, action); | 1992 ExecutePluginActionAtLocation(location, action); |
1992 } | 1993 } |
OLD | NEW |