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 19 matching lines...) Expand all Loading... |
30 #include "extensions/browser/io_thread_extension_message_filter.h" | 30 #include "extensions/browser/io_thread_extension_message_filter.h" |
31 #include "extensions/browser/process_map.h" | 31 #include "extensions/browser/process_map.h" |
32 #include "extensions/common/constants.h" | 32 #include "extensions/common/constants.h" |
33 #include "extensions/common/extension.h" | 33 #include "extensions/common/extension.h" |
34 #include "extensions/common/switches.h" | 34 #include "extensions/common/switches.h" |
35 #include "extensions/shell/browser/shell_browser_context.h" | 35 #include "extensions/shell/browser/shell_browser_context.h" |
36 #include "extensions/shell/browser/shell_browser_main_parts.h" | 36 #include "extensions/shell/browser/shell_browser_main_parts.h" |
37 #include "extensions/shell/browser/shell_extension_system.h" | 37 #include "extensions/shell/browser/shell_extension_system.h" |
38 #include "extensions/shell/browser/shell_navigation_ui_data.h" | 38 #include "extensions/shell/browser/shell_navigation_ui_data.h" |
39 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" | 39 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" |
| 40 #include "storage/browser/quota/quota_settings.h" |
40 #include "url/gurl.h" | 41 #include "url/gurl.h" |
41 | 42 |
42 #if !defined(DISABLE_NACL) | 43 #if !defined(DISABLE_NACL) |
43 #include "components/nacl/browser/nacl_browser.h" | 44 #include "components/nacl/browser/nacl_browser.h" |
44 #include "components/nacl/browser/nacl_host_message_filter.h" | 45 #include "components/nacl/browser/nacl_host_message_filter.h" |
45 #include "components/nacl/browser/nacl_process_host.h" | 46 #include "components/nacl/browser/nacl_process_host.h" |
46 #include "components/nacl/common/nacl_process_type.h" | 47 #include "components/nacl/common/nacl_process_type.h" |
47 #include "components/nacl/common/nacl_switches.h" | 48 #include "components/nacl/common/nacl_switches.h" |
48 #include "content/public/browser/browser_child_process_host.h" | 49 #include "content/public/browser/browser_child_process_host.h" |
49 #include "content/public/browser/child_process_data.h" | 50 #include "content/public/browser/child_process_data.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 bool ShellContentBrowserClient::ShouldUseProcessPerSite( | 114 bool ShellContentBrowserClient::ShouldUseProcessPerSite( |
114 content::BrowserContext* browser_context, | 115 content::BrowserContext* browser_context, |
115 const GURL& effective_url) { | 116 const GURL& effective_url) { |
116 // This ensures that all render views created for a single app will use the | 117 // This ensures that all render views created for a single app will use the |
117 // same render process (see content::SiteInstance::GetProcess). Otherwise the | 118 // same render process (see content::SiteInstance::GetProcess). Otherwise the |
118 // default behavior of ContentBrowserClient will lead to separate render | 119 // default behavior of ContentBrowserClient will lead to separate render |
119 // processes for the background page and each app window view. | 120 // processes for the background page and each app window view. |
120 return true; | 121 return true; |
121 } | 122 } |
122 | 123 |
| 124 void ShellContentBrowserClient::GetQuotaSettings( |
| 125 content::BrowserContext* context, |
| 126 const base::FilePath& partition_path, |
| 127 bool is_incognito, |
| 128 const storage::OptionalQuotaSettingsCallback& callback) { |
| 129 content::BrowserThread::PostTaskAndReplyWithResult( |
| 130 content::BrowserThread::FILE, FROM_HERE, |
| 131 base::Bind(&storage::CalculateNominalDynamicSettings, partition_path, |
| 132 is_incognito), |
| 133 callback); |
| 134 } |
| 135 |
123 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { | 136 bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { |
124 if (!url.is_valid()) | 137 if (!url.is_valid()) |
125 return false; | 138 return false; |
126 // Keep in sync with ProtocolHandlers added in | 139 // Keep in sync with ProtocolHandlers added in |
127 // ShellBrowserContext::CreateRequestContext() and in | 140 // ShellBrowserContext::CreateRequestContext() and in |
128 // content::ShellURLRequestContextGetter::GetURLRequestContext(). | 141 // content::ShellURLRequestContextGetter::GetURLRequestContext(). |
129 static const char* const kProtocolList[] = { | 142 static const char* const kProtocolList[] = { |
130 url::kBlobScheme, | 143 url::kBlobScheme, |
131 content::kChromeDevToolsScheme, | 144 content::kChromeDevToolsScheme, |
132 content::kChromeUIScheme, | 145 content::kChromeUIScheme, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 284 |
272 const Extension* ShellContentBrowserClient::GetExtension( | 285 const Extension* ShellContentBrowserClient::GetExtension( |
273 content::SiteInstance* site_instance) { | 286 content::SiteInstance* site_instance) { |
274 ExtensionRegistry* registry = | 287 ExtensionRegistry* registry = |
275 ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 288 ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
276 return registry->enabled_extensions().GetExtensionOrAppByURL( | 289 return registry->enabled_extensions().GetExtensionOrAppByURL( |
277 site_instance->GetSiteURL()); | 290 site_instance->GetSiteURL()); |
278 } | 291 } |
279 | 292 |
280 } // namespace extensions | 293 } // namespace extensions |
OLD | NEW |