OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/content_settings_observer.h" | 5 #include "chrome/renderer/content_settings_observer.h" |
6 | 6 |
7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" |
8 #include "chrome/common/url_constants.h" | 8 #include "chrome/common/url_constants.h" |
9 #include "content/common/database_messages.h" | 9 #include "content/common/database_messages.h" |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 WebSecurityOrigin origin = frame->securityOrigin(); | 138 WebSecurityOrigin origin = frame->securityOrigin(); |
139 if (origin.isEmpty()) | 139 if (origin.isEmpty()) |
140 return false; // Uninitialized document? | 140 return false; // Uninitialized document? |
141 | 141 |
142 bool result = false; | 142 bool result = false; |
143 Send(new ViewHostMsg_AllowDatabase( | 143 Send(new ViewHostMsg_AllowDatabase( |
144 routing_id(), GURL(origin.toString()), name, display_name, &result)); | 144 routing_id(), GURL(origin.toString()), name, display_name, &result)); |
145 return result; | 145 return result; |
146 } | 146 } |
147 | 147 |
| 148 bool ContentSettingsObserver::AllowFileSystem(WebFrame* frame) { |
| 149 WebSecurityOrigin origin = frame->securityOrigin(); |
| 150 if (origin.isEmpty()) |
| 151 return false; // Uninitialized document? |
| 152 |
| 153 bool result = false; |
| 154 Send(new ViewHostMsg_AllowFileSystem( |
| 155 routing_id(), GURL(origin.toString()), &result)); |
| 156 return result; |
| 157 } |
| 158 |
148 bool ContentSettingsObserver::AllowImages(WebFrame* frame, | 159 bool ContentSettingsObserver::AllowImages(WebFrame* frame, |
149 bool enabled_per_settings) { | 160 bool enabled_per_settings) { |
150 if (enabled_per_settings && | 161 if (enabled_per_settings && |
151 AllowContentType(CONTENT_SETTINGS_TYPE_IMAGES)) { | 162 AllowContentType(CONTENT_SETTINGS_TYPE_IMAGES)) { |
152 return true; | 163 return true; |
153 } | 164 } |
154 | 165 |
155 if (IsWhitelistedForContentSettings(frame)) | 166 if (IsWhitelistedForContentSettings(frame)) |
156 return true; | 167 return true; |
157 | 168 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 ContentSettingsType settings_type) { | 224 ContentSettingsType settings_type) { |
214 // CONTENT_SETTING_ASK is only valid for cookies. | 225 // CONTENT_SETTING_ASK is only valid for cookies. |
215 return current_content_settings_.settings[settings_type] != | 226 return current_content_settings_.settings[settings_type] != |
216 CONTENT_SETTING_BLOCK; | 227 CONTENT_SETTING_BLOCK; |
217 } | 228 } |
218 | 229 |
219 void ContentSettingsObserver::ClearBlockedContentSettings() { | 230 void ContentSettingsObserver::ClearBlockedContentSettings() { |
220 for (size_t i = 0; i < arraysize(content_blocked_); ++i) | 231 for (size_t i = 0; i < arraysize(content_blocked_); ++i) |
221 content_blocked_[i] = false; | 232 content_blocked_[i] = false; |
222 } | 233 } |
OLD | NEW |