| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/search_engines/template_url_service.h" | 50 #include "chrome/browser/search_engines/template_url_service.h" |
| 51 #include "chrome/browser/search_engines/template_url_service_factory.h" | 51 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 52 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 52 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 53 #include "chrome/browser/spellchecker/spellcheck_service.h" | 53 #include "chrome/browser/spellchecker/spellcheck_service.h" |
| 54 #include "chrome/browser/tab_contents/retargeting_details.h" | 54 #include "chrome/browser/tab_contents/retargeting_details.h" |
| 55 #include "chrome/browser/translate/translate_manager.h" | 55 #include "chrome/browser/translate/translate_manager.h" |
| 56 #include "chrome/browser/translate/translate_tab_helper.h" | 56 #include "chrome/browser/translate/translate_tab_helper.h" |
| 57 #include "chrome/browser/ui/browser.h" | 57 #include "chrome/browser/ui/browser.h" |
| 58 #include "chrome/browser/ui/browser_commands.h" | 58 #include "chrome/browser/ui/browser_commands.h" |
| 59 #include "chrome/browser/ui/browser_finder.h" | 59 #include "chrome/browser/ui/browser_finder.h" |
| 60 #include "chrome/browser/ui/chrome_pages.h" |
| 60 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 61 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 61 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 62 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 62 #include "chrome/common/chrome_constants.h" | 63 #include "chrome/common/chrome_constants.h" |
| 63 #include "chrome/common/chrome_switches.h" | 64 #include "chrome/common/chrome_switches.h" |
| 64 #include "chrome/common/content_restriction.h" | 65 #include "chrome/common/content_restriction.h" |
| 65 #include "chrome/common/net/url_util.h" | 66 #include "chrome/common/net/url_util.h" |
| 66 #include "chrome/common/pref_names.h" | 67 #include "chrome/common/pref_names.h" |
| 67 #include "chrome/common/render_messages.h" | 68 #include "chrome/common/render_messages.h" |
| 68 #include "chrome/common/spellcheck_messages.h" | 69 #include "chrome/common/spellcheck_messages.h" |
| 69 #include "chrome/common/url_constants.h" | 70 #include "chrome/common/url_constants.h" |
| (...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1843 OpenURL(selection_navigation_url_, | 1844 OpenURL(selection_navigation_url_, |
| 1844 GURL(), | 1845 GURL(), |
| 1845 params_.frame_id, | 1846 params_.frame_id, |
| 1846 disposition, | 1847 disposition, |
| 1847 content::PAGE_TRANSITION_LINK); | 1848 content::PAGE_TRANSITION_LINK); |
| 1848 break; | 1849 break; |
| 1849 } | 1850 } |
| 1850 case IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS: { | 1851 case IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS: { |
| 1851 WindowOpenDisposition disposition = | 1852 WindowOpenDisposition disposition = |
| 1852 ForceNewTabDispositionFromEventFlags(event_flags); | 1853 ForceNewTabDispositionFromEventFlags(event_flags); |
| 1853 std::string url = std::string(chrome::kChromeUISettingsURL) + | 1854 GURL url = chrome::GetSettingsUrl(chrome::kLanguageOptionsSubPage); |
| 1854 chrome::kLanguageOptionsSubPage; | 1855 OpenURL(url, GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); |
| 1855 OpenURL(GURL(url), GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); | |
| 1856 break; | 1856 break; |
| 1857 } | 1857 } |
| 1858 | 1858 |
| 1859 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: { | 1859 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: { |
| 1860 content::RecordAction( | 1860 content::RecordAction( |
| 1861 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings")); | 1861 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings")); |
| 1862 WindowOpenDisposition disposition = | 1862 WindowOpenDisposition disposition = |
| 1863 ForceNewTabDispositionFromEventFlags(event_flags); | 1863 ForceNewTabDispositionFromEventFlags(event_flags); |
| 1864 std::string url = std::string(chrome::kChromeUISettingsURL) + | 1864 GURL url = chrome::GetSettingsUrl(chrome::kHandlerSettingsSubPage); |
| 1865 chrome::kHandlerSettingsSubPage; | 1865 OpenURL(url, GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); |
| 1866 OpenURL(GURL(url), GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); | |
| 1867 break; | 1866 break; |
| 1868 } | 1867 } |
| 1869 | 1868 |
| 1870 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: { | 1869 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: { |
| 1871 // Make sure the model is loaded. | 1870 // Make sure the model is loaded. |
| 1872 TemplateURLService* model = | 1871 TemplateURLService* model = |
| 1873 TemplateURLServiceFactory::GetForProfile(profile_); | 1872 TemplateURLServiceFactory::GetForProfile(profile_); |
| 1874 if (!model) | 1873 if (!model) |
| 1875 return; | 1874 return; |
| 1876 model->Load(); | 1875 model->Load(); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2067 source_web_contents_->GetRenderViewHost()-> | 2066 source_web_contents_->GetRenderViewHost()-> |
| 2068 ExecuteMediaPlayerActionAtLocation(location, action); | 2067 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2069 } | 2068 } |
| 2070 | 2069 |
| 2071 void RenderViewContextMenu::PluginActionAt( | 2070 void RenderViewContextMenu::PluginActionAt( |
| 2072 const gfx::Point& location, | 2071 const gfx::Point& location, |
| 2073 const WebPluginAction& action) { | 2072 const WebPluginAction& action) { |
| 2074 source_web_contents_->GetRenderViewHost()-> | 2073 source_web_contents_->GetRenderViewHost()-> |
| 2075 ExecutePluginActionAtLocation(location, action); | 2074 ExecutePluginActionAtLocation(location, action); |
| 2076 } | 2075 } |
| OLD | NEW |