Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 3040034: Block non-sandboxed plugins. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: fix indentation; sync Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_host/render_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
12 #include "base/json/json_reader.h" 12 #include "base/json/json_reader.h"
13 #include "base/stats_counters.h" 13 #include "base/stats_counters.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/waitable_event.h" 16 #include "base/waitable_event.h"
17 #include "chrome/browser/blocked_plugin_manager.h"
17 #include "chrome/browser/browser_list.h" 18 #include "chrome/browser/browser_list.h"
18 #include "chrome/browser/child_process_security_policy.h" 19 #include "chrome/browser/child_process_security_policy.h"
19 #include "chrome/browser/cross_site_request_manager.h" 20 #include "chrome/browser/cross_site_request_manager.h"
20 #include "chrome/browser/debugger/devtools_manager.h" 21 #include "chrome/browser/debugger/devtools_manager.h"
21 #include "chrome/browser/dom_operation_notification_details.h" 22 #include "chrome/browser/dom_operation_notification_details.h"
22 #include "chrome/browser/extensions/extension_message_service.h" 23 #include "chrome/browser/extensions/extension_message_service.h"
23 #include "chrome/browser/metrics/user_metrics.h" 24 #include "chrome/browser/metrics/user_metrics.h"
24 #include "chrome/browser/notifications/desktop_notification_service.h" 25 #include "chrome/browser/notifications/desktop_notification_service.h"
25 #include "chrome/browser/profile.h" 26 #include "chrome/browser/profile.h"
26 #include "chrome/browser/renderer_host/render_process_host.h" 27 #include "chrome/browser/renderer_host/render_process_host.h"
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 OnCloseDevToolsWindow); 791 OnCloseDevToolsWindow);
791 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestDockDevToolsWindow, 792 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestDockDevToolsWindow,
792 OnRequestDockDevToolsWindow); 793 OnRequestDockDevToolsWindow);
793 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestUndockDevToolsWindow, 794 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestUndockDevToolsWindow,
794 OnRequestUndockDevToolsWindow); 795 OnRequestUndockDevToolsWindow);
795 IPC_MESSAGE_HANDLER(ViewHostMsg_DevToolsRuntimeFeatureStateChanged, 796 IPC_MESSAGE_HANDLER(ViewHostMsg_DevToolsRuntimeFeatureStateChanged,
796 OnDevToolsRuntimeFeatureStateChanged); 797 OnDevToolsRuntimeFeatureStateChanged);
797 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, 798 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction,
798 OnUserMetricsRecordAction) 799 OnUserMetricsRecordAction)
799 IPC_MESSAGE_HANDLER(ViewHostMsg_MissingPluginStatus, OnMissingPluginStatus); 800 IPC_MESSAGE_HANDLER(ViewHostMsg_MissingPluginStatus, OnMissingPluginStatus);
801 IPC_MESSAGE_HANDLER(ViewHostMsg_NonSandboxedPluginBlocked,
802 OnNonSandboxedPluginBlocked);
803 IPC_MESSAGE_HANDLER(ViewHostMsg_BlockedPluginLoaded,
804 OnBlockedPluginLoaded);
800 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin); 805 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin);
801 IPC_MESSAGE_HANDLER(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, 806 IPC_MESSAGE_HANDLER(ViewHostMsg_SendCurrentPageAllSavableResourceLinks,
802 OnReceivedSavableResourceLinksForCurrentPage); 807 OnReceivedSavableResourceLinksForCurrentPage);
803 IPC_MESSAGE_HANDLER(ViewHostMsg_SendSerializedHtmlData, 808 IPC_MESSAGE_HANDLER(ViewHostMsg_SendSerializedHtmlData,
804 OnReceivedSerializedHtmlData); 809 OnReceivedSerializedHtmlData);
805 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGetApplicationInfo, 810 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGetApplicationInfo,
806 OnDidGetApplicationInfo); 811 OnDidGetApplicationInfo);
807 IPC_MESSAGE_FORWARD(ViewHostMsg_JSOutOfMemory, delegate_, 812 IPC_MESSAGE_FORWARD(ViewHostMsg_JSOutOfMemory, delegate_,
808 RenderViewHostDelegate::OnJSOutOfMemory); 813 RenderViewHostDelegate::OnJSOutOfMemory);
809 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK); 814 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK);
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 integration_delegate->OnUserGesture(); 1528 integration_delegate->OnUserGesture();
1524 } 1529 }
1525 1530
1526 void RenderViewHost::OnMissingPluginStatus(int status) { 1531 void RenderViewHost::OnMissingPluginStatus(int status) {
1527 RenderViewHostDelegate::BrowserIntegration* integration_delegate = 1532 RenderViewHostDelegate::BrowserIntegration* integration_delegate =
1528 delegate_->GetBrowserIntegrationDelegate(); 1533 delegate_->GetBrowserIntegrationDelegate();
1529 if (integration_delegate) 1534 if (integration_delegate)
1530 integration_delegate->OnMissingPluginStatus(status); 1535 integration_delegate->OnMissingPluginStatus(status);
1531 } 1536 }
1532 1537
1538 void RenderViewHost::OnNonSandboxedPluginBlocked(const string16& name) {
1539 RenderViewHostDelegate::BlockedPlugin* blocked_plugin_delegate =
1540 delegate_->GetBlockedPluginDelegate();
1541 if (blocked_plugin_delegate) {
1542 blocked_plugin_delegate->OnNonSandboxedPluginBlocked(name);
1543 }
1544 }
1545
1546 void RenderViewHost::OnBlockedPluginLoaded() {
1547 RenderViewHostDelegate::BlockedPlugin* blocked_plugin_delegate =
1548 delegate_->GetBlockedPluginDelegate();
1549 if (blocked_plugin_delegate) {
1550 blocked_plugin_delegate->OnBlockedPluginLoaded();
1551 }
1552 }
1553
1533 void RenderViewHost::OnCrashedPlugin(const FilePath& plugin_path) { 1554 void RenderViewHost::OnCrashedPlugin(const FilePath& plugin_path) {
1534 RenderViewHostDelegate::BrowserIntegration* integration_delegate = 1555 RenderViewHostDelegate::BrowserIntegration* integration_delegate =
1535 delegate_->GetBrowserIntegrationDelegate(); 1556 delegate_->GetBrowserIntegrationDelegate();
1536 if (integration_delegate) 1557 if (integration_delegate)
1537 integration_delegate->OnCrashedPlugin(plugin_path); 1558 integration_delegate->OnCrashedPlugin(plugin_path);
1538 } 1559 }
1539 1560
1540 void RenderViewHost::GetAllSavableResourceLinksForCurrentPage( 1561 void RenderViewHost::GetAllSavableResourceLinksForCurrentPage(
1541 const GURL& page_url) { 1562 const GURL& page_url) {
1542 Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(), 1563 Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(),
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 RenderViewHostDelegate::ContentSettings* content_settings_delegate = 1997 RenderViewHostDelegate::ContentSettings* content_settings_delegate =
1977 delegate_->GetContentSettingsDelegate(); 1998 delegate_->GetContentSettingsDelegate();
1978 if (content_settings_delegate) 1999 if (content_settings_delegate)
1979 content_settings_delegate->OnWebDatabaseAccessed( 2000 content_settings_delegate->OnWebDatabaseAccessed(
1980 url, name, display_name, estimated_size, blocked_by_policy); 2001 url, name, display_name, estimated_size, blocked_by_policy);
1981 } 2002 }
1982 2003
1983 void RenderViewHost::OnSetDisplayingPDFContent() { 2004 void RenderViewHost::OnSetDisplayingPDFContent() {
1984 delegate_->SetDisplayingPDFContent(); 2005 delegate_->SetDisplayingPDFContent();
1985 } 2006 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.h ('k') | chrome/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698