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 "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) | 359 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) |
360 return true; // DevTools UI elements should still work. | 360 return true; // DevTools UI elements should still work. |
361 | 361 |
362 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) | 362 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) |
363 return true; | 363 return true; |
364 | 364 |
365 if (EqualsASCII(origin.protocol(), chrome::kChromeInternalScheme)) | 365 if (EqualsASCII(origin.protocol(), chrome::kChromeInternalScheme)) |
366 return true; | 366 return true; |
367 | 367 |
| 368 // TODO(creis, fsamuel): Remove this once the concept of swapped out |
| 369 // RenderViews goes away. |
| 370 if (document_url == GURL(content::kSwappedOutURL)) |
| 371 return true; |
| 372 |
368 // If the scheme is file:, an empty file name indicates a directory listing, | 373 // If the scheme is file:, an empty file name indicates a directory listing, |
369 // which requires JavaScript to function properly. | 374 // which requires JavaScript to function properly. |
370 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { | 375 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { |
371 return document_url.SchemeIs(chrome::kFileScheme) && | 376 return document_url.SchemeIs(chrome::kFileScheme) && |
372 document_url.ExtractFileName().empty(); | 377 document_url.ExtractFileName().empty(); |
373 } | 378 } |
374 | 379 |
375 return false; | 380 return false; |
376 } | 381 } |
OLD | NEW |