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

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: make BlockAllContentForTesting() uphold the details-is-a-valid-GURL contract 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
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 DidBlockContentType(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, origin.toString());
sky 2016/06/16 16:22:47 I'm not familiar with this code, so why is toStrin
estark 2016/06/16 16:56:58 The browser-side IPC handler expects |details| to
sky 2016/06/16 17:42:49 Can DidBlockContentType take a GURL then? Also, it
estark 2016/06/16 18:29:23 Ah, that's a good point. It appears that this coul
Jialiu Lin 2016/06/16 20:47:17 Here is the CL originally introduced this rappor m
487 return false; 487 return false;
488 } 488 }
489 489
490 return true; 490 return true;
491 } 491 }
492 492
493 bool ContentSettingsObserver::allowAutoplay(bool default_value) { 493 bool ContentSettingsObserver::allowAutoplay(bool default_value) {
494 if (!content_setting_rules_) 494 if (!content_setting_rules_)
495 return default_value; 495 return default_value;
496 496
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 627
628 // If the scheme is file:, an empty file name indicates a directory listing, 628 // If the scheme is file:, an empty file name indicates a directory listing,
629 // which requires JavaScript to function properly. 629 // which requires JavaScript to function properly.
630 if (base::EqualsASCII(protocol, url::kFileScheme)) { 630 if (base::EqualsASCII(protocol, url::kFileScheme)) {
631 return document_url.SchemeIs(url::kFileScheme) && 631 return document_url.SchemeIs(url::kFileScheme) &&
632 document_url.ExtractFileName().empty(); 632 document_url.ExtractFileName().empty();
633 } 633 }
634 634
635 return false; 635 return false;
636 } 636 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698