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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
9 #include "content/browser/browsing_instance.h" | 9 #include "content/browser/browsing_instance.h" |
10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return WebUI::kNoWebUI; | 54 return WebUI::kNoWebUI; |
55 } | 55 } |
56 virtual bool UseWebUIForURL(BrowserContext* browser_context, | 56 virtual bool UseWebUIForURL(BrowserContext* browser_context, |
57 const GURL& url) const OVERRIDE { | 57 const GURL& url) const OVERRIDE { |
58 return content::GetContentClient()->HasWebUIScheme(url); | 58 return content::GetContentClient()->HasWebUIScheme(url); |
59 } | 59 } |
60 virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, | 60 virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, |
61 const GURL& url) const OVERRIDE { | 61 const GURL& url) const OVERRIDE { |
62 return content::GetContentClient()->HasWebUIScheme(url); | 62 return content::GetContentClient()->HasWebUIScheme(url); |
63 } | 63 } |
64 virtual bool IsURLAcceptableForWebUI(BrowserContext* browser_context, | 64 virtual bool IsURLAcceptableForWebUI( |
65 const GURL& url) const OVERRIDE { | 65 BrowserContext* browser_context, |
| 66 const GURL& url, |
| 67 bool data_urls_allowed) const OVERRIDE { |
66 return false; | 68 return false; |
67 } | 69 } |
68 }; | 70 }; |
69 | 71 |
70 class SiteInstanceTestClient : public TestContentClient { | 72 class SiteInstanceTestClient : public TestContentClient { |
71 public: | 73 public: |
72 SiteInstanceTestClient() { | 74 SiteInstanceTestClient() { |
73 } | 75 } |
74 | 76 |
75 virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE { | 77 virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE { |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 host.reset(instance->GetProcess()); | 616 host.reset(instance->GetProcess()); |
615 EXPECT_TRUE(host.get() != NULL); | 617 EXPECT_TRUE(host.get() != NULL); |
616 EXPECT_TRUE(instance->HasProcess()); | 618 EXPECT_TRUE(instance->HasProcess()); |
617 | 619 |
618 EXPECT_FALSE(instance->HasWrongProcessForURL(GURL("http://evernote.com"))); | 620 EXPECT_FALSE(instance->HasWrongProcessForURL(GURL("http://evernote.com"))); |
619 EXPECT_FALSE(instance->HasWrongProcessForURL( | 621 EXPECT_FALSE(instance->HasWrongProcessForURL( |
620 GURL("javascript:alert(document.location.href);"))); | 622 GURL("javascript:alert(document.location.href);"))); |
621 | 623 |
622 EXPECT_TRUE(instance->HasWrongProcessForURL(GURL("chrome://settings"))); | 624 EXPECT_TRUE(instance->HasWrongProcessForURL(GURL("chrome://settings"))); |
623 } | 625 } |
OLD | NEW |