| 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 "components/content_settings/content/common/content_settings_messages.h
" | 9 #include "components/content_settings/content/common/content_settings_messages.h
" |
| 10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF); | 586 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF); |
| 587 | 587 |
| 588 if (!allow_running_insecure_content_ && !allowed_per_settings) { | 588 if (!allow_running_insecure_content_ && !allowed_per_settings) { |
| 589 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.host()); | 589 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.host()); |
| 590 return false; | 590 return false; |
| 591 } | 591 } |
| 592 | 592 |
| 593 return true; | 593 return true; |
| 594 } | 594 } |
| 595 | 595 |
| 596 void ContentSettingsObserver::didUseKeygen() { |
| 597 WebFrame* frame = render_frame()->GetWebFrame(); |
| 598 Send(new ChromeViewHostMsg_DidUseKeygen( |
| 599 routing_id(), |
| 600 GURL(frame->securityOrigin().toString()))); |
| 601 } |
| 602 |
| 596 void ContentSettingsObserver::didNotAllowPlugins() { | 603 void ContentSettingsObserver::didNotAllowPlugins() { |
| 597 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS); | 604 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS); |
| 598 } | 605 } |
| 599 | 606 |
| 600 void ContentSettingsObserver::didNotAllowScript() { | 607 void ContentSettingsObserver::didNotAllowScript() { |
| 601 DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT); | 608 DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT); |
| 602 } | 609 } |
| 603 | 610 |
| 604 bool ContentSettingsObserver::AreNPAPIPluginsBlocked() const { | 611 bool ContentSettingsObserver::AreNPAPIPluginsBlocked() const { |
| 605 return npapi_plugins_blocked_; | 612 return npapi_plugins_blocked_; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 | 731 |
| 725 // If the scheme is file:, an empty file name indicates a directory listing, | 732 // If the scheme is file:, an empty file name indicates a directory listing, |
| 726 // which requires JavaScript to function properly. | 733 // which requires JavaScript to function properly. |
| 727 if (base::EqualsASCII(protocol, url::kFileScheme)) { | 734 if (base::EqualsASCII(protocol, url::kFileScheme)) { |
| 728 return document_url.SchemeIs(url::kFileScheme) && | 735 return document_url.SchemeIs(url::kFileScheme) && |
| 729 document_url.ExtractFileName().empty(); | 736 document_url.ExtractFileName().empty(); |
| 730 } | 737 } |
| 731 | 738 |
| 732 return false; | 739 return false; |
| 733 } | 740 } |
| OLD | NEW |