| 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/ssl_insecure_content.h" | 7 #include "chrome/common/ssl_insecure_content.h" |
| 8 #include "components/content_settings/content/common/content_settings_messages.h
" | 8 #include "components/content_settings/content/common/content_settings_messages.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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 return allowed; | 392 return allowed; |
| 393 } | 393 } |
| 394 | 394 |
| 395 bool ContentSettingsObserver::allowMutationEvents(bool default_value) { | 395 bool ContentSettingsObserver::allowMutationEvents(bool default_value) { |
| 396 return IsPlatformApp() ? false : default_value; | 396 return IsPlatformApp() ? false : default_value; |
| 397 } | 397 } |
| 398 | 398 |
| 399 bool ContentSettingsObserver::allowDisplayingInsecureContent( | 399 bool ContentSettingsObserver::allowDisplayingInsecureContent( |
| 400 bool allowed_per_settings, | 400 bool allowed_per_settings, |
| 401 const blink::WebURL& resource_url) { | 401 const blink::WebURL& resource_url) { |
| 402 // Note: this implementation is a mirror of |
| 403 // ChromeContentBrowserClient::ShouldAllowDisplayingInsecureContent |
| 402 ReportInsecureContent(SslInsecureContentType::DISPLAY); | 404 ReportInsecureContent(SslInsecureContentType::DISPLAY); |
| 403 FilteredReportInsecureContentDisplayed(GURL(resource_url)); | 405 FilteredReportInsecureContentDisplayed(GURL(resource_url)); |
| 404 | 406 |
| 405 if (allowed_per_settings || allow_displaying_insecure_content_) | 407 if (allowed_per_settings || allow_displaying_insecure_content_) |
| 406 return true; | 408 return true; |
| 407 | 409 |
| 408 Send(new ChromeViewHostMsg_DidBlockDisplayingInsecureContent(routing_id())); | 410 Send(new ChromeViewHostMsg_DidBlockDisplayingInsecureContent(routing_id())); |
| 409 | 411 |
| 410 return false; | 412 return false; |
| 411 } | 413 } |
| 412 | 414 |
| 413 bool ContentSettingsObserver::allowRunningInsecureContent( | 415 bool ContentSettingsObserver::allowRunningInsecureContent( |
| 414 bool allowed_per_settings, | 416 bool allowed_per_settings, |
| 415 const blink::WebSecurityOrigin& origin, | 417 const blink::WebSecurityOrigin& origin, |
| 416 const blink::WebURL& resource_url) { | 418 const blink::WebURL& resource_url) { |
| 419 // Note: this implementation is a mirror of |
| 420 // ChromeContentBrowserClient::ShouldAllowRunningInsecureContent |
| 417 FilteredReportInsecureContentRan(GURL(resource_url)); | 421 FilteredReportInsecureContentRan(GURL(resource_url)); |
| 418 | 422 |
| 419 if (!allow_running_insecure_content_ && !allowed_per_settings) { | 423 if (!allow_running_insecure_content_ && !allowed_per_settings) { |
| 420 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT); | 424 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT); |
| 421 return false; | 425 return false; |
| 422 } | 426 } |
| 423 | 427 |
| 424 return true; | 428 return true; |
| 425 } | 429 } |
| 426 | 430 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 565 |
| 562 // If the scheme is file:, an empty file name indicates a directory listing, | 566 // If the scheme is file:, an empty file name indicates a directory listing, |
| 563 // which requires JavaScript to function properly. | 567 // which requires JavaScript to function properly. |
| 564 if (base::EqualsASCII(protocol, url::kFileScheme)) { | 568 if (base::EqualsASCII(protocol, url::kFileScheme)) { |
| 565 return document_url.SchemeIs(url::kFileScheme) && | 569 return document_url.SchemeIs(url::kFileScheme) && |
| 566 document_url.ExtractFileName().empty(); | 570 document_url.ExtractFileName().empty(); |
| 567 } | 571 } |
| 568 | 572 |
| 569 return false; | 573 return false; |
| 570 } | 574 } |
| OLD | NEW |