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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
512 // The <browser> tag is implemented via Shadow DOM. | 512 // The <browser> tag is implemented via Shadow DOM. |
513 if (HasExtensionPermission(origin, APIPermission::kBrowserTag)) | 513 if (HasExtensionPermission(origin, APIPermission::kBrowserTag)) |
514 return true; | 514 return true; |
515 | 515 |
516 if (HasExtensionPermission(origin, APIPermission::kExperimental)) | 516 if (HasExtensionPermission(origin, APIPermission::kExperimental)) |
517 return true; | 517 return true; |
518 | 518 |
519 return false; | 519 return false; |
520 } | 520 } |
521 | 521 |
522 bool ChromeRenderViewObserver::allowHTMLNotifications( | |
Mihai Parparita -not on Chrome
2012/07/26 17:27:12
Can you add a test for this? It should be somethin
jianli
2012/07/26 21:27:46
I've fixed and re-enabled existing notification AP
| |
523 const WebDocument& document) { | |
524 WebSecurityOrigin origin = document.securityOrigin(); | |
525 return HasExtensionPermission(origin, APIPermission::kNotification); | |
526 } | |
527 | |
522 static void SendInsecureContentSignal(int signal) { | 528 static void SendInsecureContentSignal(int signal) { |
523 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", signal, | 529 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", signal, |
524 INSECURE_CONTENT_NUM_EVENTS); | 530 INSECURE_CONTENT_NUM_EVENTS); |
525 } | 531 } |
526 | 532 |
527 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( | 533 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( |
528 WebKit::WebFrame* frame, | 534 WebKit::WebFrame* frame, |
529 bool allowed_per_settings, | 535 bool allowed_per_settings, |
530 const WebKit::WebSecurityOrigin& origin, | 536 const WebKit::WebSecurityOrigin& origin, |
531 const WebKit::WebURL& resource_url) { | 537 const WebKit::WebURL& resource_url) { |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1083 reinterpret_cast<const unsigned char*>(&data[0]); | 1089 reinterpret_cast<const unsigned char*>(&data[0]); |
1084 | 1090 |
1085 return decoder.Decode(src_data, data.size()); | 1091 return decoder.Decode(src_data, data.size()); |
1086 } | 1092 } |
1087 return SkBitmap(); | 1093 return SkBitmap(); |
1088 } | 1094 } |
1089 | 1095 |
1090 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 1096 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
1091 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 1097 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
1092 } | 1098 } |
OLD | NEW |