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

Unified Diff: chrome/browser/plugins/flash_permission_context.cc

Issue 2354443002: Implement PluginsPermissionContext and hookup to flash download interception. (Closed)
Patch Set: Implement PluginsPermissionContext and hookup to flash download interception. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugins/flash_permission_context.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/flash_permission_context.cc
diff --git a/chrome/browser/plugins/flash_permission_context.cc b/chrome/browser/plugins/flash_permission_context.cc
index f70d341637b8a341a4e1a1384f787a966ecdc1eb..38c8ccb3e158ada216cba160600a540f34561025 100644
--- a/chrome/browser/plugins/flash_permission_context.cc
+++ b/chrome/browser/plugins/flash_permission_context.cc
@@ -4,6 +4,15 @@
#include "chrome/browser/plugins/flash_permission_context.h"
+#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
+#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/browser/permissions/permission_request_id.h"
+#include "chrome/browser/plugins/plugin_utils.h"
+#include "chrome/browser/plugins/plugins_field_trial.h"
+#include "chrome/browser/ui/website_settings/website_settings_infobar_delegate.h"
+#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "content/public/browser/render_frame_host.h"
+
FlashPermissionContext::FlashPermissionContext(Profile* profile)
: PermissionContextBase(profile,
content::PermissionType::FLASH,
@@ -11,6 +20,34 @@ FlashPermissionContext::FlashPermissionContext(Profile* profile)
FlashPermissionContext::~FlashPermissionContext() {}
+ContentSetting FlashPermissionContext::GetPermissionStatus(
+ const GURL& requesting_origin,
+ const GURL& embedding_origin) const {
+ ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting(
+ HostContentSettingsMapFactory::GetForProfile(profile()), embedding_origin,
+ requesting_origin);
+ flash_setting = PluginsFieldTrial::EffectiveContentSetting(
+ CONTENT_SETTINGS_TYPE_PLUGINS, flash_setting);
+ if (flash_setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT)
+ return CONTENT_SETTING_ASK;
+ return flash_setting;
+}
+
+void FlashPermissionContext::UpdateTabContext(const PermissionRequestID& id,
+ const GURL& requesting_origin,
+ bool allowed) {
+ if (!allowed)
+ return;
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(
+ content::RenderFrameHost::FromID(id.render_process_id(),
+ id.render_frame_id()));
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ if (infobar_service)
+ WebsiteSettingsInfoBarDelegate::Create(infobar_service);
+}
+
bool FlashPermissionContext::IsRestrictedToSecureOrigins() const {
return false;
}
« no previous file with comments | « chrome/browser/plugins/flash_permission_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698