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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 349 |
350 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme)) | 350 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme)) |
351 return true; // Browser UI elements should still work. | 351 return true; // Browser UI elements should still work. |
352 | 352 |
353 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) | 353 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) |
354 return true; // DevTools UI elements should still work. | 354 return true; // DevTools UI elements should still work. |
355 | 355 |
356 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) | 356 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) |
357 return true; | 357 return true; |
358 | 358 |
359 if (EqualsASCII(origin.protocol(), chrome::kChromeInternalScheme)) | |
360 return true; | |
361 | |
362 // TODO(creis, fsamuel): Remove this once the concept of swapped out | 359 // TODO(creis, fsamuel): Remove this once the concept of swapped out |
363 // RenderViews goes away. | 360 // RenderViews goes away. |
364 if (document_url == GURL(content::kSwappedOutURL)) | 361 if (document_url == GURL(content::kSwappedOutURL)) |
365 return true; | 362 return true; |
366 | 363 |
367 // If the scheme is file:, an empty file name indicates a directory listing, | 364 // If the scheme is file:, an empty file name indicates a directory listing, |
368 // which requires JavaScript to function properly. | 365 // which requires JavaScript to function properly. |
369 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { | 366 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { |
370 return document_url.SchemeIs(chrome::kFileScheme) && | 367 return document_url.SchemeIs(chrome::kFileScheme) && |
371 document_url.ExtractFileName().empty(); | 368 document_url.ExtractFileName().empty(); |
372 } | 369 } |
373 | 370 |
374 return false; | 371 return false; |
375 } | 372 } |
OLD | NEW |