| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/shell/browser/shell_content_browser_client.h" | 5 #include "extensions/shell/browser/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return true; | 117 return true; |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { | 120 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { |
| 121 if (!url.is_valid()) | 121 if (!url.is_valid()) |
| 122 return false; | 122 return false; |
| 123 // Keep in sync with ProtocolHandlers added in | 123 // Keep in sync with ProtocolHandlers added in |
| 124 // ShellBrowserContext::CreateRequestContext() and in | 124 // ShellBrowserContext::CreateRequestContext() and in |
| 125 // content::ShellURLRequestContextGetter::GetURLRequestContext(). | 125 // content::ShellURLRequestContextGetter::GetURLRequestContext(). |
| 126 static const char* const kProtocolList[] = { | 126 static const char* const kProtocolList[] = { |
| 127 url::kBlobScheme, | 127 url::kBlobScheme, content::kChromeDevToolsScheme, |
| 128 content::kChromeDevToolsScheme, | 128 content::kChromeUIScheme, url::kDataScheme, |
| 129 content::kChromeUIScheme, | 129 url::kFileScheme, url::kFileSystemScheme, |
| 130 url::kDataScheme, | 130 url::kHttpScheme, url::kHttpsScheme, |
| 131 url::kFileScheme, | 131 url::kWsScheme, url::kWssScheme, |
| 132 url::kFileSystemScheme, | 132 kExtensionScheme, kExtensionResourceScheme, |
| 133 kExtensionScheme, | |
| 134 kExtensionResourceScheme, | |
| 135 }; | 133 }; |
| 136 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 134 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
| 137 if (url.scheme() == kProtocolList[i]) | 135 if (url.scheme() == kProtocolList[i]) |
| 138 return true; | 136 return true; |
| 139 } | 137 } |
| 140 return false; | 138 return false; |
| 141 } | 139 } |
| 142 | 140 |
| 143 void ShellContentBrowserClient::SiteInstanceGotProcess( | 141 void ShellContentBrowserClient::SiteInstanceGotProcess( |
| 144 content::SiteInstance* site_instance) { | 142 content::SiteInstance* site_instance) { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 252 |
| 255 const Extension* ShellContentBrowserClient::GetExtension( | 253 const Extension* ShellContentBrowserClient::GetExtension( |
| 256 content::SiteInstance* site_instance) { | 254 content::SiteInstance* site_instance) { |
| 257 ExtensionRegistry* registry = | 255 ExtensionRegistry* registry = |
| 258 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 256 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
| 259 return registry->enabled_extensions().GetExtensionOrAppByURL( | 257 return registry->enabled_extensions().GetExtensionOrAppByURL( |
| 260 site_instance->GetSiteURL()); | 258 site_instance->GetSiteURL()); |
| 261 } | 259 } |
| 262 | 260 |
| 263 } // namespace extensions | 261 } // namespace extensions |
| OLD | NEW |