OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ssl_insecure_content.h" | 8 #include "chrome/common/ssl_insecure_content.h" |
9 #include "content/public/common/url_constants.h" | 9 #include "content/public/common/url_constants.h" |
10 #include "content/public/renderer/document_state.h" | 10 #include "content/public/renderer/document_state.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 void ContentSettingsObserver::SetAllowRunningInsecureContent() { | 210 void ContentSettingsObserver::SetAllowRunningInsecureContent() { |
211 allow_running_insecure_content_ = true; | 211 allow_running_insecure_content_ = true; |
212 | 212 |
213 // Reload if we are the main frame. | 213 // Reload if we are the main frame. |
214 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); | 214 blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); |
215 if (!frame->Parent()) | 215 if (!frame->Parent()) |
216 frame->Reload(blink::WebFrameLoadType::kReload); | 216 frame->Reload(blink::WebFrameLoadType::kReload); |
217 } | 217 } |
218 | 218 |
219 void ContentSettingsObserver::OnInsecureContentRendererRequest( | 219 void ContentSettingsObserver::OnInsecureContentRendererRequest( |
| 220 const service_manager::BindSourceInfo& source_info, |
220 chrome::mojom::InsecureContentRendererRequest request) { | 221 chrome::mojom::InsecureContentRendererRequest request) { |
221 insecure_content_renderer_bindings_.AddBinding(this, std::move(request)); | 222 insecure_content_renderer_bindings_.AddBinding(this, std::move(request)); |
222 } | 223 } |
223 | 224 |
224 bool ContentSettingsObserver::AllowDatabase(const WebString& name, | 225 bool ContentSettingsObserver::AllowDatabase(const WebString& name, |
225 const WebString& display_name, | 226 const WebString& display_name, |
226 unsigned estimated_size) { | 227 unsigned estimated_size) { |
227 WebFrame* frame = render_frame()->GetWebFrame(); | 228 WebFrame* frame = render_frame()->GetWebFrame(); |
228 if (frame->GetSecurityOrigin().IsUnique() || | 229 if (frame->GetSecurityOrigin().IsUnique() || |
229 frame->Top()->GetSecurityOrigin().IsUnique()) | 230 frame->Top()->GetSecurityOrigin().IsUnique()) |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 #endif | 540 #endif |
540 | 541 |
541 // If the scheme is file:, an empty file name indicates a directory listing, | 542 // If the scheme is file:, an empty file name indicates a directory listing, |
542 // which requires JavaScript to function properly. | 543 // which requires JavaScript to function properly. |
543 if (protocol == url::kFileScheme && | 544 if (protocol == url::kFileScheme && |
544 document_url.ProtocolIs(url::kFileScheme)) { | 545 document_url.ProtocolIs(url::kFileScheme)) { |
545 return GURL(document_url).ExtractFileName().empty(); | 546 return GURL(document_url).ExtractFileName().empty(); |
546 } | 547 } |
547 return false; | 548 return false; |
548 } | 549 } |
OLD | NEW |