summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/renderer_webstoragearea_impl.cc
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-13 18:18:41 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-13 18:18:41 +0000
commitf985f3c3cea99bb8e0a8d182cc9830b9fa4b0272 (patch)
tree0a76adc73990d836b008fa0974bcc60e7b3ac5eb /chrome/renderer/renderer_webstoragearea_impl.cc
parent8d76a4a3b1051c55c772f46fa9da8531ddb4efc3 (diff)
downloadchromium_src-f985f3c3cea99bb8e0a8d182cc9830b9fa4b0272.zip
chromium_src-f985f3c3cea99bb8e0a8d182cc9830b9fa4b0272.tar.gz
chromium_src-f985f3c3cea99bb8e0a8d182cc9830b9fa4b0272.tar.bz2
Only ask the user on setItems whether they want to allow dom storage.
Also add some plumbing for popping up an icon when it's blocked. TEST=Turn on the ask content setting for a domain and set local storage and then clear it. Only the set should prompt you. BUG=34668 Review URL: http://codereview.chromium.org/600078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_webstoragearea_impl.cc')
-rw-r--r--chrome/renderer/renderer_webstoragearea_impl.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/renderer/renderer_webstoragearea_impl.cc b/chrome/renderer/renderer_webstoragearea_impl.cc
index 43caed5..20ce740 100644
--- a/chrome/renderer/renderer_webstoragearea_impl.cc
+++ b/chrome/renderer/renderer_webstoragearea_impl.cc
@@ -6,8 +6,11 @@
#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h"
+#include "chrome/renderer/render_view.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
+using WebKit::WebFrame;
using WebKit::WebString;
using WebKit::WebURL;
@@ -44,12 +47,20 @@ WebString RendererWebStorageAreaImpl::getItem(const WebString& key) {
void RendererWebStorageAreaImpl::setItem(
const WebString& key, const WebString& value, const WebURL& url,
- bool& quota_exception, WebString& old_value_webkit) {
+ WebStorageArea::Result& result, WebString& old_value_webkit) {
NullableString16 old_value;
RenderThread::current()->Send(
new ViewHostMsg_DOMStorageSetItem(storage_area_id_, key, value, url,
- &quota_exception, &old_value));
+ &result, &old_value));
old_value_webkit = old_value;
+
+ if (result == WebStorageArea::ResultBlockedByPolicy) {
+ RenderView* view =
+ RenderView::FromWebView(WebFrame::frameForCurrentContext()->view());
+ DCHECK(view);
+ RenderThread::current()->Send(new ViewHostMsg_ContentBlocked(
+ view->routing_id(), CONTENT_SETTINGS_TYPE_COOKIES));
+ }
}
void RendererWebStorageAreaImpl::removeItem(