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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 if (const extensions::Extension* extension = GetExtension(origin)) { | 426 if (const extensions::Extension* extension = GetExtension(origin)) { |
427 if (extension->HasAPIPermission(APIPermission::kExperimental)) | 427 if (extension->HasAPIPermission(APIPermission::kExperimental)) |
428 return true; | 428 return true; |
429 } | 429 } |
430 | 430 |
431 return false; | 431 return false; |
432 } | 432 } |
433 | 433 |
434 bool ChromeRenderViewObserver::allowHTMLNotifications( | 434 bool ChromeRenderViewObserver::allowHTMLNotifications( |
435 const WebDocument& document) { | 435 const WebDocument& document) { |
| 436 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 437 if (command_line->HasSwitch(switches::kDisableHTMLNotifications)) |
| 438 return false; |
| 439 |
436 WebSecurityOrigin origin = document.securityOrigin(); | 440 WebSecurityOrigin origin = document.securityOrigin(); |
437 const extensions::Extension* extension = GetExtension(origin); | 441 const extensions::Extension* extension = GetExtension(origin); |
438 return extension && extension->HasAPIPermission(APIPermission::kNotification); | 442 return extension && extension->HasAPIPermission(APIPermission::kNotification); |
439 } | 443 } |
440 | 444 |
441 bool ChromeRenderViewObserver::allowMutationEvents(const WebDocument& document, | 445 bool ChromeRenderViewObserver::allowMutationEvents(const WebDocument& document, |
442 bool default_value) { | 446 bool default_value) { |
443 WebSecurityOrigin origin = document.securityOrigin(); | 447 WebSecurityOrigin origin = document.securityOrigin(); |
444 const extensions::Extension* extension = GetExtension(origin); | 448 const extensions::Extension* extension = GetExtension(origin); |
445 if (extension && extension->is_platform_app()) | 449 if (extension && extension->is_platform_app()) |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 if (!external_host_bindings_.get()) { | 784 if (!external_host_bindings_.get()) { |
781 external_host_bindings_.reset(new ExternalHostBindings( | 785 external_host_bindings_.reset(new ExternalHostBindings( |
782 render_view(), routing_id())); | 786 render_view(), routing_id())); |
783 } | 787 } |
784 return external_host_bindings_.get(); | 788 return external_host_bindings_.get(); |
785 } | 789 } |
786 | 790 |
787 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 791 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
788 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 792 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
789 } | 793 } |
OLD | NEW |