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/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 // - The document is running Web UI. | 491 // - The document is running Web UI. |
492 WebSecurityOrigin origin = document.securityOrigin(); | 492 WebSecurityOrigin origin = document.securityOrigin(); |
493 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme)) | 493 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme)) |
494 return true; | 494 return true; |
495 const extensions::Extension* extension = | 495 const extensions::Extension* extension = |
496 extension_dispatcher_->extensions()->GetExtensionOrAppByURL( | 496 extension_dispatcher_->extensions()->GetExtensionOrAppByURL( |
497 ExtensionURLInfo(origin, document.url())); | 497 ExtensionURLInfo(origin, document.url())); |
498 if (!extension) | 498 if (!extension) |
499 return false; | 499 return false; |
500 return (extension_dispatcher_->IsExtensionActive(extension->id()) && | 500 return (extension_dispatcher_->IsExtensionActive(extension->id()) && |
501 extension->HasAPIPermission(ExtensionAPIPermission::kExperimental)); | 501 extension->HasAPIPermission( |
| 502 extensions::APIPermission::kExperimental)); |
502 } | 503 } |
503 | 504 |
504 bool ChromeRenderViewObserver::allowWebComponents(const WebDocument& document, | 505 bool ChromeRenderViewObserver::allowWebComponents(const WebDocument& document, |
505 bool defaultValue) { | 506 bool defaultValue) { |
506 if (defaultValue) | 507 if (defaultValue) |
507 return true; | 508 return true; |
508 return IsExperimentalWebFeatureAllowed(document); | 509 return IsExperimentalWebFeatureAllowed(document); |
509 } | 510 } |
510 | 511 |
511 static void SendInsecureContentSignal(int signal) { | 512 static void SendInsecureContentSignal(int signal) { |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 reinterpret_cast<const unsigned char*>(&data[0]); | 1073 reinterpret_cast<const unsigned char*>(&data[0]); |
1073 | 1074 |
1074 return decoder.Decode(src_data, data.size()); | 1075 return decoder.Decode(src_data, data.size()); |
1075 } | 1076 } |
1076 return SkBitmap(); | 1077 return SkBitmap(); |
1077 } | 1078 } |
1078 | 1079 |
1079 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 1080 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
1080 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 1081 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
1081 } | 1082 } |
OLD | NEW |