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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 const GURL& document_url) { | 629 const GURL& document_url) { |
630 if (document_url == GURL(content::kUnreachableWebDataURL)) | 630 if (document_url == GURL(content::kUnreachableWebDataURL)) |
631 return true; | 631 return true; |
632 | 632 |
633 if (origin.isUnique()) | 633 if (origin.isUnique()) |
634 return false; // Uninitialized document? | 634 return false; // Uninitialized document? |
635 | 635 |
636 if (EqualsASCII(origin.protocol(), content::kChromeUIScheme)) | 636 if (EqualsASCII(origin.protocol(), content::kChromeUIScheme)) |
637 return true; // Browser UI elements should still work. | 637 return true; // Browser UI elements should still work. |
638 | 638 |
639 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) | 639 if (EqualsASCII(origin.protocol(), content::kChromeDevToolsScheme)) |
640 return true; // DevTools UI elements should still work. | 640 return true; // DevTools UI elements should still work. |
641 | 641 |
642 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) | 642 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) |
643 return true; | 643 return true; |
644 | 644 |
645 // TODO(creis, fsamuel): Remove this once the concept of swapped out | 645 // TODO(creis, fsamuel): Remove this once the concept of swapped out |
646 // RenderFrames goes away. | 646 // RenderFrames goes away. |
647 if (document_url == GURL(content::kSwappedOutURL)) | 647 if (document_url == GURL(content::kSwappedOutURL)) |
648 return true; | 648 return true; |
649 | 649 |
650 // If the scheme is file:, an empty file name indicates a directory listing, | 650 // If the scheme is file:, an empty file name indicates a directory listing, |
651 // which requires JavaScript to function properly. | 651 // which requires JavaScript to function properly. |
652 if (EqualsASCII(origin.protocol(), content::kFileScheme)) { | 652 if (EqualsASCII(origin.protocol(), content::kFileScheme)) { |
653 return document_url.SchemeIs(content::kFileScheme) && | 653 return document_url.SchemeIs(content::kFileScheme) && |
654 document_url.ExtractFileName().empty(); | 654 document_url.ExtractFileName().empty(); |
655 } | 655 } |
656 | 656 |
657 return false; | 657 return false; |
658 } | 658 } |
OLD | NEW |