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

Side by Side Diff: chrome/browser/in_process_webkit/dom_storage_area.cc

Issue 2878075: Introduce a resource identifier for content settings. (Closed)
Patch Set: updates Created 10 years, 4 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 unified diff | Download patch
OLDNEW
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/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "chrome/browser/chrome_thread.h" 10 #include "chrome/browser/chrome_thread.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 void DOMStorageArea::CreateWebStorageAreaIfNecessary() { 92 void DOMStorageArea::CreateWebStorageAreaIfNecessary() {
93 if (!storage_area_.get()) 93 if (!storage_area_.get())
94 storage_area_.reset(owner_->CreateWebStorageArea(origin_)); 94 storage_area_.reset(owner_->CreateWebStorageArea(origin_));
95 } 95 }
96 96
97 bool DOMStorageArea::CheckContentSetting( 97 bool DOMStorageArea::CheckContentSetting(
98 const string16& key, const string16& value, 98 const string16& key, const string16& value,
99 DOMStorageDispatcherHost* sender) { 99 DOMStorageDispatcherHost* sender) {
100 ContentSetting content_setting = 100 ContentSetting content_setting =
101 host_content_settings_map_->GetContentSetting( 101 host_content_settings_map_->GetContentSetting(
102 origin_url_, CONTENT_SETTINGS_TYPE_COOKIES); 102 origin_url_, CONTENT_SETTINGS_TYPE_COOKIES, "");
103 103
104 if (content_setting == CONTENT_SETTING_ASK) { 104 if (content_setting == CONTENT_SETTING_ASK) {
105 DOMStoragePermissionRequest request(origin_url_, key, value, 105 DOMStoragePermissionRequest request(origin_url_, key, value,
106 host_content_settings_map_); 106 host_content_settings_map_);
107 ChromeThread::PostTask( 107 ChromeThread::PostTask(
108 ChromeThread::UI, FROM_HERE, 108 ChromeThread::UI, FROM_HERE,
109 NewRunnableFunction(&DOMStoragePermissionRequest::PromptUser, 109 NewRunnableFunction(&DOMStoragePermissionRequest::PromptUser,
110 &request)); 110 &request));
111 // Tell the renderer that it needs to run a nested message loop. 111 // Tell the renderer that it needs to run a nested message loop.
112 sender->Send(new ViewMsg_SignalCookiePromptEvent()); 112 sender->Send(new ViewMsg_SignalCookiePromptEvent());
113 content_setting = request.WaitOnResponse(); 113 content_setting = request.WaitOnResponse();
114 } 114 }
115 115
116 return (content_setting != CONTENT_SETTING_BLOCK); 116 return (content_setting != CONTENT_SETTING_BLOCK);
117 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698