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

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

Issue 2048303002: Fix broken mixed script Rappor metric and add browser test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments Created 4 years, 6 months 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
« no previous file with comments | « chrome/renderer/content_settings_observer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 base::CompareCase::INSENSITIVE_ASCII)) 476 base::CompareCase::INSENSITIVE_ASCII))
477 SendInsecureContentSignal(INSECURE_CONTENT_RUN_JS); 477 SendInsecureContentSignal(INSECURE_CONTENT_RUN_JS);
478 else if (base::EndsWith(resource_gurl.path(), kDotCSS, 478 else if (base::EndsWith(resource_gurl.path(), kDotCSS,
479 base::CompareCase::INSENSITIVE_ASCII)) 479 base::CompareCase::INSENSITIVE_ASCII))
480 SendInsecureContentSignal(INSECURE_CONTENT_RUN_CSS); 480 SendInsecureContentSignal(INSECURE_CONTENT_RUN_CSS);
481 else if (base::EndsWith(resource_gurl.path(), kDotSWF, 481 else if (base::EndsWith(resource_gurl.path(), kDotSWF,
482 base::CompareCase::INSENSITIVE_ASCII)) 482 base::CompareCase::INSENSITIVE_ASCII))
483 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF); 483 SendInsecureContentSignal(INSECURE_CONTENT_RUN_SWF);
484 484
485 if (!allow_running_insecure_content_ && !allowed_per_settings) { 485 if (!allow_running_insecure_content_ && !allowed_per_settings) {
486 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.host()); 486 // The browser process expects the |details| argument to contain a
487 // valid GURL from which the mixed script was run.
488 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString());
487 return false; 489 return false;
488 } 490 }
489 491
490 return true; 492 return true;
491 } 493 }
492 494
493 bool ContentSettingsObserver::allowAutoplay(bool default_value) { 495 bool ContentSettingsObserver::allowAutoplay(bool default_value) {
494 if (!content_setting_rules_) 496 if (!content_setting_rules_)
495 return default_value; 497 return default_value;
496 498
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 629
628 // If the scheme is file:, an empty file name indicates a directory listing, 630 // If the scheme is file:, an empty file name indicates a directory listing,
629 // which requires JavaScript to function properly. 631 // which requires JavaScript to function properly.
630 if (base::EqualsASCII(protocol, url::kFileScheme)) { 632 if (base::EqualsASCII(protocol, url::kFileScheme)) {
631 return document_url.SchemeIs(url::kFileScheme) && 633 return document_url.SchemeIs(url::kFileScheme) &&
632 document_url.ExtractFileName().empty(); 634 document_url.ExtractFileName().empty();
633 } 635 }
634 636
635 return false; 637 return false;
636 } 638 }
OLDNEW
« no previous file with comments | « chrome/renderer/content_settings_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698