| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/in_process_webkit/dom_storage_area.h" | 5 #include "chrome/browser/in_process_webkit/dom_storage_area.h" |
| 6 | 6 |
| 7 #include "base/task.h" | 7 #include "base/task.h" |
| 8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
| 9 #include "chrome/browser/in_process_webkit/dom_storage_context.h" | 9 #include "chrome/browser/in_process_webkit/dom_storage_context.h" |
| 10 #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" | 10 #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" |
| 11 #include "chrome/browser/in_process_webkit/dom_storage_namespace.h" | 11 #include "chrome/browser/in_process_webkit/dom_storage_namespace.h" |
| 12 #include "chrome/browser/in_process_webkit/dom_storage_permission_request.h" | |
| 13 #include "chrome/browser/host_content_settings_map.h" | 12 #include "chrome/browser/host_content_settings_map.h" |
| 14 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
| 15 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" |
| 16 #include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 19 #include "webkit/glue/webkit_glue.h" | 18 #include "webkit/glue/webkit_glue.h" |
| 20 | 19 |
| 21 using WebKit::WebSecurityOrigin; | 20 using WebKit::WebSecurityOrigin; |
| 22 using WebKit::WebStorageArea; | 21 using WebKit::WebStorageArea; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if (!storage_area_.get()) | 90 if (!storage_area_.get()) |
| 92 storage_area_.reset(owner_->CreateWebStorageArea(origin_)); | 91 storage_area_.reset(owner_->CreateWebStorageArea(origin_)); |
| 93 } | 92 } |
| 94 | 93 |
| 95 bool DOMStorageArea::CheckContentSetting( | 94 bool DOMStorageArea::CheckContentSetting( |
| 96 const string16& key, const string16& value, | 95 const string16& key, const string16& value, |
| 97 DOMStorageDispatcherHost* sender) { | 96 DOMStorageDispatcherHost* sender) { |
| 98 ContentSetting content_setting = | 97 ContentSetting content_setting = |
| 99 host_content_settings_map_->GetContentSetting( | 98 host_content_settings_map_->GetContentSetting( |
| 100 origin_url_, CONTENT_SETTINGS_TYPE_COOKIES, ""); | 99 origin_url_, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 101 | |
| 102 if (content_setting == CONTENT_SETTING_ASK) { | |
| 103 DOMStoragePermissionRequest request(origin_url_, key, value, | |
| 104 host_content_settings_map_); | |
| 105 ChromeThread::PostTask( | |
| 106 ChromeThread::UI, FROM_HERE, | |
| 107 NewRunnableFunction(&DOMStoragePermissionRequest::PromptUser, | |
| 108 &request)); | |
| 109 // Tell the renderer that it needs to run a nested message loop. | |
| 110 sender->Send(new ViewMsg_SignalCookiePromptEvent()); | |
| 111 content_setting = request.WaitOnResponse(); | |
| 112 } | |
| 113 | |
| 114 return (content_setting != CONTENT_SETTING_BLOCK); | 100 return (content_setting != CONTENT_SETTING_BLOCK); |
| 115 } | 101 } |
| OLD | NEW |