| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 SendInsecureContentSignal(INSECURE_CONTENT_RUN_TARGET_YOUTUBE); | 572 SendInsecureContentSignal(INSECURE_CONTENT_RUN_TARGET_YOUTUBE); |
| 573 | 573 |
| 574 if (EndsWith(resource_gurl.path(), kDotJS, false)) | 574 if (EndsWith(resource_gurl.path(), kDotJS, false)) |
| 575 SendInsecureContentSignal(INSECURE_CONTENT_RUN_JS); | 575 SendInsecureContentSignal(INSECURE_CONTENT_RUN_JS); |
| 576 else if (EndsWith(resource_gurl.path(), kDotCSS, false)) | 576 else if (EndsWith(resource_gurl.path(), kDotCSS, false)) |
| 577 SendInsecureContentSignal(INSECURE_CONTENT_RUN_CSS); | 577 SendInsecureContentSignal(INSECURE_CONTENT_RUN_CSS); |
| 578 else if (EndsWith(resource_gurl.path(), kDotSWF, false)) | 578 else if (EndsWith(resource_gurl.path(), kDotSWF, false)) |
| 579 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF); | 579 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF); |
| 580 | 580 |
| 581 if (!allow_running_insecure_content_ && !allowed_per_settings) { | 581 if (!allow_running_insecure_content_ && !allowed_per_settings) { |
| 582 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT); | 582 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.host()); |
| 583 return false; | 583 return false; |
| 584 } | 584 } |
| 585 | 585 |
| 586 return true; | 586 return true; |
| 587 } | 587 } |
| 588 | 588 |
| 589 void ContentSettingsObserver::didNotAllowPlugins() { | 589 void ContentSettingsObserver::didNotAllowPlugins() { |
| 590 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS); | 590 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS); |
| 591 } | 591 } |
| 592 | 592 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 | 716 |
| 717 // If the scheme is file:, an empty file name indicates a directory listing, | 717 // If the scheme is file:, an empty file name indicates a directory listing, |
| 718 // which requires JavaScript to function properly. | 718 // which requires JavaScript to function properly. |
| 719 if (EqualsASCII(origin.protocol(), url::kFileScheme)) { | 719 if (EqualsASCII(origin.protocol(), url::kFileScheme)) { |
| 720 return document_url.SchemeIs(url::kFileScheme) && | 720 return document_url.SchemeIs(url::kFileScheme) && |
| 721 document_url.ExtractFileName().empty(); | 721 document_url.ExtractFileName().empty(); |
| 722 } | 722 } |
| 723 | 723 |
| 724 return false; | 724 return false; |
| 725 } | 725 } |
| OLD | NEW |