| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/shell/browser/shell_content_browser_client.h" | 5 #include "apps/shell/browser/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include "apps/shell/browser/shell_browser_context.h" | 7 #include "apps/shell/browser/shell_browser_context.h" |
| 8 #include "apps/shell/browser/shell_browser_main_parts.h" | 8 #include "apps/shell/browser/shell_browser_main_parts.h" |
| 9 #include "apps/shell/browser/shell_extension_system.h" | 9 #include "apps/shell/browser/shell_extension_system.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 protocol_handlers); | 69 protocol_handlers); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { | 72 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { |
| 73 if (!url.is_valid()) | 73 if (!url.is_valid()) |
| 74 return false; | 74 return false; |
| 75 // Keep in sync with ProtocolHandlers added in CreateRequestContext() and in | 75 // Keep in sync with ProtocolHandlers added in CreateRequestContext() and in |
| 76 // content::ShellURLRequestContextGetter::GetURLRequestContext(). | 76 // content::ShellURLRequestContextGetter::GetURLRequestContext(). |
| 77 static const char* const kProtocolList[] = { | 77 static const char* const kProtocolList[] = { |
| 78 chrome::kBlobScheme, | 78 chrome::kBlobScheme, |
| 79 chrome::kChromeUIScheme, | |
| 80 chrome::kChromeDevToolsScheme, | 79 chrome::kChromeDevToolsScheme, |
| 80 content::kChromeUIScheme, |
| 81 content::kDataScheme, | 81 content::kDataScheme, |
| 82 content::kFileScheme, | 82 content::kFileScheme, |
| 83 content::kFileSystemScheme, | 83 content::kFileSystemScheme, |
| 84 extensions::kExtensionScheme, | 84 extensions::kExtensionScheme, |
| 85 extensions::kExtensionResourceScheme, | 85 extensions::kExtensionResourceScheme, |
| 86 }; | 86 }; |
| 87 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 87 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
| 88 if (url.scheme() == kProtocolList[i]) | 88 if (url.scheme() == kProtocolList[i]) |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 const extensions::Extension* ShellContentBrowserClient::GetExtension( | 150 const extensions::Extension* ShellContentBrowserClient::GetExtension( |
| 151 content::SiteInstance* site_instance) { | 151 content::SiteInstance* site_instance) { |
| 152 ExtensionRegistry* registry = | 152 ExtensionRegistry* registry = |
| 153 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 153 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
| 154 return registry->enabled_extensions().GetExtensionOrAppByURL( | 154 return registry->enabled_extensions().GetExtensionOrAppByURL( |
| 155 site_instance->GetSiteURL()); | 155 site_instance->GetSiteURL()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace apps | 158 } // namespace apps |
| OLD | NEW |