Index: chrome/browser/content_settings/tab_specific_content_settings.cc |
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc |
index e54d95839627cde3a55f39cf2f47d1da1211353b..3bba0120821461625cb4570894aeeba51068a1d3 100644 |
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc |
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc |
@@ -19,6 +19,7 @@ |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/content_settings/content_settings_details.h" |
#include "chrome/browser/content_settings/content_settings_utils.h" |
+#include "chrome/browser/content_settings/cookie_settings.h" |
#include "chrome/browser/content_settings/host_content_settings_map.h" |
#include "chrome/browser/prerender/prerender_manager.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -343,6 +344,26 @@ void TabSpecificContentSettings::OnContentAllowed(ContentSettingsType type) { |
} |
} |
+void TabSpecificContentSettings::OnRequestFileSystemAccess( |
+ const IPC::Message& message) { |
+ ChromeViewHostMsg_RequestFileSystemAccess::Param param; |
+ if (!ChromeViewHostMsg_RequestFileSystemAccess::Read(&message, ¶m)) |
kinuko
2014/03/05 08:35:44
nit: I think you could directly read out params li
Fady Samuel
2014/03/06 18:38:25
Done.
|
+ return; |
+ |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
+ scoped_refptr<CookieSettings> cookie_settings( |
+ CookieSettings::Factory::GetForProfile(profile)); |
+ int request_id = param.a; |
+ const GURL& origin_url = param.b; |
+ const GURL& top_origin_url = param.c; |
+ bool allowed = |
+ cookie_settings->IsSettingCookieAllowed(origin_url, top_origin_url); |
+ OnFileSystemAccessed(origin_url, !allowed); |
+ Send(new ChromeViewMsg_RequestFileSystemAccess_ACK( |
+ message.routing_id(), request_id, allowed)); |
+} |
+ |
void TabSpecificContentSettings::OnCookiesRead( |
const GURL& url, |
const GURL& frame_url, |
@@ -640,6 +661,8 @@ bool TabSpecificContentSettings::OnMessageReceived( |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(TabSpecificContentSettings, message) |
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ContentBlocked, OnContentBlocked) |
+ IPC_MESSAGE_HANDLER_GENERIC(ChromeViewHostMsg_RequestFileSystemAccess, |
+ OnRequestFileSystemAccess(message)) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |