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/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 | 646 |
647 if (origin.isUnique()) | 647 if (origin.isUnique()) |
648 return false; // Uninitialized document? | 648 return false; // Uninitialized document? |
649 | 649 |
650 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme)) | 650 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme)) |
651 return true; // Browser UI elements should still work. | 651 return true; // Browser UI elements should still work. |
652 | 652 |
653 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) | 653 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) |
654 return true; // DevTools UI elements should still work. | 654 return true; // DevTools UI elements should still work. |
655 | 655 |
656 if (EqualsASCII(origin.protocol(), chrome::kDomDistillerScheme)) | |
nasko
2014/01/16 23:39:12
See the other comment in host_content_settings_map
nyquist
2014/01/22 00:47:58
Removed.
| |
657 return true; // DOM Distiller viewer elements should still work. | |
658 | |
656 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) | 659 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) |
657 return true; | 660 return true; |
658 | 661 |
659 // TODO(creis, fsamuel): Remove this once the concept of swapped out | 662 // TODO(creis, fsamuel): Remove this once the concept of swapped out |
660 // RenderFrames goes away. | 663 // RenderFrames goes away. |
661 if (document_url == GURL(content::kSwappedOutURL)) | 664 if (document_url == GURL(content::kSwappedOutURL)) |
662 return true; | 665 return true; |
663 | 666 |
664 // If the scheme is file:, an empty file name indicates a directory listing, | 667 // If the scheme is file:, an empty file name indicates a directory listing, |
665 // which requires JavaScript to function properly. | 668 // which requires JavaScript to function properly. |
666 if (EqualsASCII(origin.protocol(), content::kFileScheme)) { | 669 if (EqualsASCII(origin.protocol(), content::kFileScheme)) { |
667 return document_url.SchemeIs(content::kFileScheme) && | 670 return document_url.SchemeIs(content::kFileScheme) && |
668 document_url.ExtractFileName().empty(); | 671 document_url.ExtractFileName().empty(); |
669 } | 672 } |
670 | 673 |
671 return false; | 674 return false; |
672 } | 675 } |
OLD | NEW |