| 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 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); |
| 1320 return; | 1329 return; |
| 1321 } | 1330 } |
| 1322 | 1331 |
| 1323 // Process extension menu items. | 1332 // Process extension menu items. |
| 1324 if (id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST && | 1333 if (id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST && |
| 1325 id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { | 1334 id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { |
| 1326 extension_items_.ExecuteCommand(id, source_web_contents_, params_); | 1335 extension_items_.ExecuteCommand(id, source_web_contents_, params_); |
| 1327 return; | 1336 return; |
| 1328 } | 1337 } |
| 1329 | 1338 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 source_web_contents_->GetRenderViewHost()-> | 1866 source_web_contents_->GetRenderViewHost()-> |
| 1858 ExecuteMediaPlayerActionAtLocation(location, action); | 1867 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1859 } | 1868 } |
| 1860 | 1869 |
| 1861 void RenderViewContextMenu::PluginActionAt( | 1870 void RenderViewContextMenu::PluginActionAt( |
| 1862 const gfx::Point& location, | 1871 const gfx::Point& location, |
| 1863 const WebPluginAction& action) { | 1872 const WebPluginAction& action) { |
| 1864 source_web_contents_->GetRenderViewHost()-> | 1873 source_web_contents_->GetRenderViewHost()-> |
| 1865 ExecutePluginActionAtLocation(location, action); | 1874 ExecutePluginActionAtLocation(location, action); |
| 1866 } | 1875 } |
| OLD | NEW |