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