OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/tab_contents/render_view_context_menu.h" | 5 #include "chrome/browser/tab_contents/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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 48 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
49 #include "chrome/browser/spellchecker/spellcheck_service.h" | 49 #include "chrome/browser/spellchecker/spellcheck_service.h" |
50 #include "chrome/browser/tab_contents/retargeting_details.h" | 50 #include "chrome/browser/tab_contents/retargeting_details.h" |
51 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" | 51 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
52 #include "chrome/browser/tab_contents/spelling_menu_observer.h" | 52 #include "chrome/browser/tab_contents/spelling_menu_observer.h" |
53 #include "chrome/browser/translate/translate_manager.h" | 53 #include "chrome/browser/translate/translate_manager.h" |
54 #include "chrome/browser/translate/translate_tab_helper.h" | 54 #include "chrome/browser/translate/translate_tab_helper.h" |
55 #include "chrome/browser/ui/browser.h" | 55 #include "chrome/browser/ui/browser.h" |
56 #include "chrome/browser/ui/browser_commands.h" | 56 #include "chrome/browser/ui/browser_commands.h" |
57 #include "chrome/browser/ui/browser_finder.h" | 57 #include "chrome/browser/ui/browser_finder.h" |
| 58 #include "chrome/browser/ui/chrome_pages.h" |
58 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 59 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
59 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 60 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
60 #include "chrome/common/chrome_constants.h" | 61 #include "chrome/common/chrome_constants.h" |
61 #include "chrome/common/chrome_switches.h" | 62 #include "chrome/common/chrome_switches.h" |
62 #include "chrome/common/content_restriction.h" | 63 #include "chrome/common/content_restriction.h" |
63 #include "chrome/common/net/url_util.h" | 64 #include "chrome/common/net/url_util.h" |
64 #include "chrome/common/pref_names.h" | 65 #include "chrome/common/pref_names.h" |
65 #include "chrome/common/render_messages.h" | 66 #include "chrome/common/render_messages.h" |
66 #include "chrome/common/spellcheck_messages.h" | 67 #include "chrome/common/spellcheck_messages.h" |
67 #include "chrome/common/url_constants.h" | 68 #include "chrome/common/url_constants.h" |
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 OpenURL(selection_navigation_url_, | 1894 OpenURL(selection_navigation_url_, |
1894 GURL(), | 1895 GURL(), |
1895 params_.frame_id, | 1896 params_.frame_id, |
1896 disposition, | 1897 disposition, |
1897 content::PAGE_TRANSITION_LINK); | 1898 content::PAGE_TRANSITION_LINK); |
1898 break; | 1899 break; |
1899 } | 1900 } |
1900 case IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS: { | 1901 case IDC_CONTENT_CONTEXT_LANGUAGE_SETTINGS: { |
1901 WindowOpenDisposition disposition = | 1902 WindowOpenDisposition disposition = |
1902 ForceNewTabDispositionFromEventFlags(event_flags); | 1903 ForceNewTabDispositionFromEventFlags(event_flags); |
1903 std::string url = std::string(chrome::kChromeUISettingsURL) + | 1904 GURL url = chrome::GetSettingsUrl(chrome::kLanguageOptionsSubPage); |
1904 chrome::kLanguageOptionsSubPage; | 1905 OpenURL(url, GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); |
1905 OpenURL(GURL(url), GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); | |
1906 break; | 1906 break; |
1907 } | 1907 } |
1908 | 1908 |
1909 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: { | 1909 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: { |
1910 content::RecordAction( | 1910 content::RecordAction( |
1911 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings")); | 1911 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings")); |
1912 WindowOpenDisposition disposition = | 1912 WindowOpenDisposition disposition = |
1913 ForceNewTabDispositionFromEventFlags(event_flags); | 1913 ForceNewTabDispositionFromEventFlags(event_flags); |
1914 std::string url = std::string(chrome::kChromeUISettingsURL) + | 1914 GURL url = chrome::GetSettingsUrl(chrome::kHandlerSettingsSubPage); |
1915 chrome::kHandlerSettingsSubPage; | 1915 OpenURL(url, GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); |
1916 OpenURL(GURL(url), GURL(), 0, disposition, content::PAGE_TRANSITION_LINK); | |
1917 break; | 1916 break; |
1918 } | 1917 } |
1919 | 1918 |
1920 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: { | 1919 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: { |
1921 // Make sure the model is loaded. | 1920 // Make sure the model is loaded. |
1922 TemplateURLService* model = | 1921 TemplateURLService* model = |
1923 TemplateURLServiceFactory::GetForProfile(profile_); | 1922 TemplateURLServiceFactory::GetForProfile(profile_); |
1924 if (!model) | 1923 if (!model) |
1925 return; | 1924 return; |
1926 model->Load(); | 1925 model->Load(); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 source_web_contents_->GetRenderViewHost()-> | 2110 source_web_contents_->GetRenderViewHost()-> |
2112 ExecuteMediaPlayerActionAtLocation(location, action); | 2111 ExecuteMediaPlayerActionAtLocation(location, action); |
2113 } | 2112 } |
2114 | 2113 |
2115 void RenderViewContextMenu::PluginActionAt( | 2114 void RenderViewContextMenu::PluginActionAt( |
2116 const gfx::Point& location, | 2115 const gfx::Point& location, |
2117 const WebPluginAction& action) { | 2116 const WebPluginAction& action) { |
2118 source_web_contents_->GetRenderViewHost()-> | 2117 source_web_contents_->GetRenderViewHost()-> |
2119 ExecutePluginActionAtLocation(location, action); | 2118 ExecutePluginActionAtLocation(location, action); |
2120 } | 2119 } |
OLD | NEW |