OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/guestview/webview/plugin_permission_helper.h" | 5 #include "chrome/browser/guestview/webview/plugin_permission_helper.h" |
6 | 6 |
7 #include "chrome/browser/guestview/webview/webview_guest.h" | 7 #include "chrome/browser/guestview/webview/webview_guest.h" |
8 #include "chrome/browser/guestview/webview/webview_permission_types.h" | 8 #include "chrome/browser/guestview/webview/webview_permission_types.h" |
9 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 9 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 void PluginPermissionHelper::OnFindMissingPlugin(int placeholder_id, | 93 void PluginPermissionHelper::OnFindMissingPlugin(int placeholder_id, |
94 const std::string& mime_type) { | 94 const std::string& mime_type) { |
95 } | 95 } |
96 | 96 |
97 void PluginPermissionHelper::OnRemovePluginPlaceholderHost(int placeholder_id) { | 97 void PluginPermissionHelper::OnRemovePluginPlaceholderHost(int placeholder_id) { |
98 } | 98 } |
99 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 99 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
100 | 100 |
101 void PluginPermissionHelper::OnPermissionResponse(const std::string& identifier, | 101 void PluginPermissionHelper::OnPermissionResponse(const std::string& identifier, |
102 bool allow, | 102 bool allow, |
103 const std::string& input) { | 103 const std::string& input, |
104 bool user_initiated) { | |
104 if (allow) { | 105 if (allow) { |
105 RenderViewHost* host = web_contents()->GetRenderViewHost(); | 106 RenderViewHost* host = web_contents()->GetRenderViewHost(); |
106 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( | 107 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( |
107 host->GetProcess()->GetID()); | 108 host->GetProcess()->GetID()); |
108 host->Send(new ChromeViewMsg_LoadBlockedPlugins( | 109 host->Send(new ChromeViewMsg_LoadBlockedPlugins( |
109 host->GetRoutingID(), identifier)); | 110 host->GetRoutingID(), identifier)); |
110 } | 111 } |
111 | 112 |
113 // Should we restrict this only for |user_initiated| = true? | |
lazyboy
2013/11/12 18:16:59
FYI: Pending question. For other permissions, I'm
Fady Samuel
2013/11/13 19:29:52
It's useful to record when plugin requests happen
lazyboy
2013/11/13 19:52:50
In that case we can record two separate pairs, a p
| |
112 content::RecordAction( | 114 content::RecordAction( |
113 allow ? content::UserMetricsAction("WebView.Guest.PluginLoadAllowed") : | 115 allow ? content::UserMetricsAction("WebView.Guest.PluginLoadAllowed") : |
114 content::UserMetricsAction("WebView.Guest.PluginLoadDenied")); | 116 content::UserMetricsAction("WebView.Guest.PluginLoadDenied")); |
115 } | 117 } |
OLD | NEW |