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 "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 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/autocomplete/autocomplete_match.h" | 22 #include "chrome/browser/autocomplete/autocomplete_match.h" |
23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/devtools/devtools_window.h" | 24 #include "chrome/browser/devtools/devtools_window.h" |
25 #include "chrome/browser/download/download_service.h" | 25 #include "chrome/browser/download/download_service.h" |
26 #include "chrome/browser/download/download_service_factory.h" | 26 #include "chrome/browser/download/download_service_factory.h" |
27 #include "chrome/browser/download/download_util.h" | 27 #include "chrome/browser/download/download_util.h" |
28 #include "chrome/browser/extensions/extension_host.h" | 28 #include "chrome/browser/extensions/extension_host.h" |
29 #include "chrome/browser/extensions/extension_service.h" | 29 #include "chrome/browser/extensions/extension_service.h" |
30 #include "chrome/browser/extensions/extension_system.h" | 30 #include "chrome/browser/extensions/extension_system.h" |
31 #include "chrome/browser/google/google_util.h" | 31 #include "chrome/browser/google/google_util.h" |
32 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | |
33 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 32 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
34 #include "chrome/browser/prefs/pref_service.h" | 33 #include "chrome/browser/prefs/pref_service.h" |
35 #include "chrome/browser/printing/print_preview_context_menu_observer.h" | 34 #include "chrome/browser/printing/print_preview_context_menu_observer.h" |
36 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 35 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
37 #include "chrome/browser/printing/print_view_manager.h" | 36 #include "chrome/browser/printing/print_view_manager.h" |
38 #include "chrome/browser/profiles/profile.h" | 37 #include "chrome/browser/profiles/profile.h" |
39 #include "chrome/browser/profiles/profile_io_data.h" | 38 #include "chrome/browser/profiles/profile_io_data.h" |
40 #include "chrome/browser/search_engines/template_url.h" | 39 #include "chrome/browser/search_engines/template_url.h" |
41 #include "chrome/browser/search_engines/template_url_service.h" | 40 #include "chrome/browser/search_engines/template_url_service.h" |
42 #include "chrome/browser/search_engines/template_url_service_factory.h" | 41 #include "chrome/browser/search_engines/template_url_service_factory.h" |
(...skipping 21 matching lines...) Expand all Loading... |
64 #include "chrome/common/print_messages.h" | 63 #include "chrome/common/print_messages.h" |
65 #include "chrome/common/spellcheck_messages.h" | 64 #include "chrome/common/spellcheck_messages.h" |
66 #include "chrome/common/url_constants.h" | 65 #include "chrome/common/url_constants.h" |
67 #include "content/public/browser/child_process_security_policy.h" | 66 #include "content/public/browser/child_process_security_policy.h" |
68 #include "content/public/browser/download_manager.h" | 67 #include "content/public/browser/download_manager.h" |
69 #include "content/public/browser/download_save_info.h" | 68 #include "content/public/browser/download_save_info.h" |
70 #include "content/public/browser/download_url_parameters.h" | 69 #include "content/public/browser/download_url_parameters.h" |
71 #include "content/public/browser/navigation_details.h" | 70 #include "content/public/browser/navigation_details.h" |
72 #include "content/public/browser/navigation_entry.h" | 71 #include "content/public/browser/navigation_entry.h" |
73 #include "content/public/browser/notification_service.h" | 72 #include "content/public/browser/notification_service.h" |
74 #include "content/public/browser/render_process_host.h" | |
75 #include "content/public/browser/render_view_host.h" | 73 #include "content/public/browser/render_view_host.h" |
76 #include "content/public/browser/render_widget_host_view.h" | 74 #include "content/public/browser/render_widget_host_view.h" |
77 #include "content/public/browser/user_metrics.h" | 75 #include "content/public/browser/user_metrics.h" |
78 #include "content/public/browser/web_contents.h" | 76 #include "content/public/browser/web_contents.h" |
79 #include "content/public/common/content_restriction.h" | 77 #include "content/public/common/content_restriction.h" |
80 #include "content/public/common/ssl_status.h" | 78 #include "content/public/common/ssl_status.h" |
81 #include "grit/generated_resources.h" | 79 #include "grit/generated_resources.h" |
82 #include "net/base/escape.h" | 80 #include "net/base/escape.h" |
83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" | 81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" | 82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 if (observer->IsCommandIdSupported(id)) | 1309 if (observer->IsCommandIdSupported(id)) |
1312 return observer->ExecuteCommand(id); | 1310 return observer->ExecuteCommand(id); |
1313 } | 1311 } |
1314 | 1312 |
1315 RenderViewHost* rvh = source_web_contents_->GetRenderViewHost(); | 1313 RenderViewHost* rvh = source_web_contents_->GetRenderViewHost(); |
1316 | 1314 |
1317 // Process custom actions range. | 1315 // Process custom actions range. |
1318 if (id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST && | 1316 if (id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST && |
1319 id <= IDC_CONTENT_CONTEXT_CUSTOM_LAST) { | 1317 id <= IDC_CONTENT_CONTEXT_CUSTOM_LAST) { |
1320 unsigned action = id - IDC_CONTENT_CONTEXT_CUSTOM_FIRST; | 1318 unsigned action = id - IDC_CONTENT_CONTEXT_CUSTOM_FIRST; |
1321 const content::CustomContextMenuContext& context = params_.custom_context; | 1319 rvh->ExecuteCustomContextMenuCommand(action, params_.custom_context); |
1322 #if defined(ENABLE_PLUGINS) | |
1323 if (context.request_id && !context.is_pepper_menu) { | |
1324 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( | |
1325 rvh->GetProcess()->GetID()); | |
1326 } | |
1327 #endif | |
1328 rvh->ExecuteCustomContextMenuCommand(action, context); | |
1329 return; | 1320 return; |
1330 } | 1321 } |
1331 | 1322 |
1332 // Process extension menu items. | 1323 // Process extension menu items. |
1333 if (id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST && | 1324 if (id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST && |
1334 id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { | 1325 id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { |
1335 extension_items_.ExecuteCommand(id, source_web_contents_, params_); | 1326 extension_items_.ExecuteCommand(id, source_web_contents_, params_); |
1336 return; | 1327 return; |
1337 } | 1328 } |
1338 | 1329 |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 source_web_contents_->GetRenderViewHost()-> | 1857 source_web_contents_->GetRenderViewHost()-> |
1867 ExecuteMediaPlayerActionAtLocation(location, action); | 1858 ExecuteMediaPlayerActionAtLocation(location, action); |
1868 } | 1859 } |
1869 | 1860 |
1870 void RenderViewContextMenu::PluginActionAt( | 1861 void RenderViewContextMenu::PluginActionAt( |
1871 const gfx::Point& location, | 1862 const gfx::Point& location, |
1872 const WebPluginAction& action) { | 1863 const WebPluginAction& action) { |
1873 source_web_contents_->GetRenderViewHost()-> | 1864 source_web_contents_->GetRenderViewHost()-> |
1874 ExecutePluginActionAtLocation(location, action); | 1865 ExecutePluginActionAtLocation(location, action); |
1875 } | 1866 } |
OLD | NEW |