Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2218)

Side by Side Diff: chrome/renderer/content_settings_observer.cc

Issue 1417033010: Adding <keygen> Content Setting (Blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keygen_core
Patch Set: Rebase? Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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::usedKeygen() {
597 WebFrame* frame = render_frame()->GetWebFrame();
598 bool allow = false;
599 Send(new ChromeViewHostMsg_AllowKeygen(
600 routing_id(), GURL(frame->securityOrigin().toString()), &allow));
601 if (!allow)
602 DidBlockContentType(CONTENT_SETTINGS_TYPE_KEYGEN);
603 }
604
596 void ContentSettingsObserver::didNotAllowPlugins() { 605 void ContentSettingsObserver::didNotAllowPlugins() {
597 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS); 606 DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS);
598 } 607 }
599 608
600 void ContentSettingsObserver::didNotAllowScript() { 609 void ContentSettingsObserver::didNotAllowScript() {
601 DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT); 610 DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT);
602 } 611 }
603 612
604 bool ContentSettingsObserver::AreNPAPIPluginsBlocked() const { 613 bool ContentSettingsObserver::AreNPAPIPluginsBlocked() const {
605 return npapi_plugins_blocked_; 614 return npapi_plugins_blocked_;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 733
725 // If the scheme is file:, an empty file name indicates a directory listing, 734 // If the scheme is file:, an empty file name indicates a directory listing,
726 // which requires JavaScript to function properly. 735 // which requires JavaScript to function properly.
727 if (base::EqualsASCII(protocol, url::kFileScheme)) { 736 if (base::EqualsASCII(protocol, url::kFileScheme)) {
728 return document_url.SchemeIs(url::kFileScheme) && 737 return document_url.SchemeIs(url::kFileScheme) &&
729 document_url.ExtractFileName().empty(); 738 document_url.ExtractFileName().empty();
730 } 739 }
731 740
732 return false; 741 return false;
733 } 742 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698