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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } | 447 } |
448 } | 448 } |
449 #endif | 449 #endif |
450 return allowed; | 450 return allowed; |
451 } | 451 } |
452 | 452 |
453 bool ContentSettingsObserver::allowMutationEvents(bool default_value) { | 453 bool ContentSettingsObserver::allowMutationEvents(bool default_value) { |
454 return IsPlatformApp() ? false : default_value; | 454 return IsPlatformApp() ? false : default_value; |
455 } | 455 } |
456 | 456 |
457 bool ContentSettingsObserver::allowPushState() { | |
458 return !IsPlatformApp(); | |
459 } | |
460 | |
461 static void SendInsecureContentSignal(int signal) { | 457 static void SendInsecureContentSignal(int signal) { |
462 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", signal, | 458 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", signal, |
463 INSECURE_CONTENT_NUM_EVENTS); | 459 INSECURE_CONTENT_NUM_EVENTS); |
464 } | 460 } |
465 | 461 |
466 bool ContentSettingsObserver::allowDisplayingInsecureContent( | 462 bool ContentSettingsObserver::allowDisplayingInsecureContent( |
467 bool allowed_per_settings, | 463 bool allowed_per_settings, |
468 const blink::WebSecurityOrigin& origin, | 464 const blink::WebSecurityOrigin& origin, |
469 const blink::WebURL& resource_url) { | 465 const blink::WebURL& resource_url) { |
470 SendInsecureContentSignal(INSECURE_CONTENT_DISPLAY); | 466 SendInsecureContentSignal(INSECURE_CONTENT_DISPLAY); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 | 711 |
716 // If the scheme is file:, an empty file name indicates a directory listing, | 712 // If the scheme is file:, an empty file name indicates a directory listing, |
717 // which requires JavaScript to function properly. | 713 // which requires JavaScript to function properly. |
718 if (EqualsASCII(origin.protocol(), url::kFileScheme)) { | 714 if (EqualsASCII(origin.protocol(), url::kFileScheme)) { |
719 return document_url.SchemeIs(url::kFileScheme) && | 715 return document_url.SchemeIs(url::kFileScheme) && |
720 document_url.ExtractFileName().empty(); | 716 document_url.ExtractFileName().empty(); |
721 } | 717 } |
722 | 718 |
723 return false; | 719 return false; |
724 } | 720 } |
OLD | NEW |