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