summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-20 17:58:32 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-20 17:58:32 +0000
commit8c1ae5ec4d47638315096f54819793484383c91f (patch)
treec7749cae01663511be911c22e3928f7ef5aa8aab /chrome/browser/renderer_host
parente90eca1550812bb5694c9523ffc75963c845d46d (diff)
downloadchromium_src-8c1ae5ec4d47638315096f54819793484383c91f.zip
chromium_src-8c1ae5ec4d47638315096f54819793484383c91f.tar.gz
chromium_src-8c1ae5ec4d47638315096f54819793484383c91f.tar.bz2
Pass in the HostContentSettingsMap to the CookieModalDialog so IsValid can make its decision. Before, it used the TabContents to get the profile to get the map, but this was incorrect because the current tab isn't necessarily from the same profile as the original request.
As long as we have the HostContentSettingsMap, we might as well handle "remember" in CookieModalDialog. This bug exists in 4.1. TEST=none BUG=none Review URL: http://codereview.chromium.org/651023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/database_permission_request.cc27
-rw-r--r--chrome/browser/renderer_host/database_permission_request.h6
2 files changed, 13 insertions, 20 deletions
diff --git a/chrome/browser/renderer_host/database_permission_request.cc b/chrome/browser/renderer_host/database_permission_request.cc
index 29030de..9d96d0d 100644
--- a/chrome/browser/renderer_host/database_permission_request.cc
+++ b/chrome/browser/renderer_host/database_permission_request.cc
@@ -41,13 +41,13 @@ void DatabasePermissionRequest::RequestPermission() {
ContentSetting setting = host_content_settings_map_->GetContentSetting(
url_, CONTENT_SETTINGS_TYPE_COOKIES);
if (setting != CONTENT_SETTING_ASK) {
- SendResponse(setting, false);
+ SendResponse(setting);
return;
}
Browser* browser = BrowserList::GetLastActive();
if (!browser || !browser->GetSelectedTabContents()) {
- BlockSiteData(false);
+ BlockSiteData();
return;
}
@@ -55,30 +55,23 @@ void DatabasePermissionRequest::RequestPermission() {
self_ref_ = this;
// Will call either AllowSiteData or BlockSiteData which will NULL out our
// self reference.
- RunDatabasePrompt(browser->GetSelectedTabContents(), url_,
- database_name_, this);
+ RunDatabasePrompt(browser->GetSelectedTabContents(),
+ host_content_settings_map_, url_, database_name_, this);
#else
// TODO(jorlow): Enable prompting for other ports.
- BlockSiteData(false);
+ BlockSiteData();
#endif
}
-void DatabasePermissionRequest::AllowSiteData(bool remember,
- bool session_expire) {
- SendResponse(CONTENT_SETTING_ALLOW, remember);
+void DatabasePermissionRequest::AllowSiteData(bool session_expire) {
+ SendResponse(CONTENT_SETTING_ALLOW);
}
-void DatabasePermissionRequest::BlockSiteData(bool remember) {
- SendResponse(CONTENT_SETTING_BLOCK, remember);
+void DatabasePermissionRequest::BlockSiteData() {
+ SendResponse(CONTENT_SETTING_BLOCK);
}
-void DatabasePermissionRequest::SendResponse(ContentSetting content_setting,
- bool remember) {
- if (remember) {
- host_content_settings_map_->SetContentSetting(
- url_.host(), CONTENT_SETTINGS_TYPE_COOKIES, content_setting);
- }
-
+void DatabasePermissionRequest::SendResponse(ContentSetting content_setting) {
if (content_setting == CONTENT_SETTING_ALLOW) {
ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, on_allow_.release());
} else {
diff --git a/chrome/browser/renderer_host/database_permission_request.h b/chrome/browser/renderer_host/database_permission_request.h
index 5cf391c..8b3f033 100644
--- a/chrome/browser/renderer_host/database_permission_request.h
+++ b/chrome/browser/renderer_host/database_permission_request.h
@@ -34,11 +34,11 @@ class DatabasePermissionRequest
void RequestPermission();
// CookiesPromptViewDelegate methods:
- virtual void AllowSiteData(bool remember, bool session_expire);
- virtual void BlockSiteData(bool remember);
+ virtual void AllowSiteData(bool session_expire);
+ virtual void BlockSiteData();
private:
- void SendResponse(ContentSetting content_setting, bool remember);
+ void SendResponse(ContentSetting content_setting);
// The URL to get permission for.
const GURL url_;