| 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 "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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 return true; // Browser UI elements should still work. | 613 return true; // Browser UI elements should still work. |
| 614 | 614 |
| 615 if (base::EqualsASCII(protocol, content::kChromeDevToolsScheme)) | 615 if (base::EqualsASCII(protocol, content::kChromeDevToolsScheme)) |
| 616 return true; // DevTools UI elements should still work. | 616 return true; // DevTools UI elements should still work. |
| 617 | 617 |
| 618 #if defined(ENABLE_EXTENSIONS) | 618 #if defined(ENABLE_EXTENSIONS) |
| 619 if (base::EqualsASCII(protocol, extensions::kExtensionScheme)) | 619 if (base::EqualsASCII(protocol, extensions::kExtensionScheme)) |
| 620 return true; | 620 return true; |
| 621 #endif | 621 #endif |
| 622 | 622 |
| 623 // TODO(creis, fsamuel): Remove this once the concept of swapped out | |
| 624 // RenderFrames goes away. | |
| 625 if (document_url == GURL(content::kSwappedOutURL)) | |
| 626 return true; | |
| 627 | |
| 628 // If the scheme is file:, an empty file name indicates a directory listing, | 623 // If the scheme is file:, an empty file name indicates a directory listing, |
| 629 // which requires JavaScript to function properly. | 624 // which requires JavaScript to function properly. |
| 630 if (base::EqualsASCII(protocol, url::kFileScheme)) { | 625 if (base::EqualsASCII(protocol, url::kFileScheme)) { |
| 631 return document_url.SchemeIs(url::kFileScheme) && | 626 return document_url.SchemeIs(url::kFileScheme) && |
| 632 document_url.ExtractFileName().empty(); | 627 document_url.ExtractFileName().empty(); |
| 633 } | 628 } |
| 634 | 629 |
| 635 return false; | 630 return false; |
| 636 } | 631 } |
| OLD | NEW |