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/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/content_settings/content_settings_utils.h" | 29 #include "chrome/browser/content_settings/content_settings_utils.h" |
30 #include "chrome/browser/content_settings/cookie_settings.h" | 30 #include "chrome/browser/content_settings/cookie_settings.h" |
31 #include "chrome/browser/content_settings/host_content_settings_map.h" | 31 #include "chrome/browser/content_settings/host_content_settings_map.h" |
32 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 32 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
33 #include "chrome/browser/defaults.h" | 33 #include "chrome/browser/defaults.h" |
34 #include "chrome/browser/download/download_prefs.h" | 34 #include "chrome/browser/download/download_prefs.h" |
35 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 35 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
36 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h" | 36 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h" |
37 #include "chrome/browser/extensions/extension_host.h" | 37 #include "chrome/browser/extensions/extension_host.h" |
38 #include "chrome/browser/extensions/extension_service.h" | 38 #include "chrome/browser/extensions/extension_service.h" |
39 #include "chrome/browser/extensions/extension_system.h" | |
40 #include "chrome/browser/extensions/extension_web_ui.h" | 39 #include "chrome/browser/extensions/extension_web_ui.h" |
41 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 40 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
42 #include "chrome/browser/extensions/suggest_permission_util.h" | 41 #include "chrome/browser/extensions/suggest_permission_util.h" |
43 #include "chrome/browser/geolocation/chrome_access_token_store.h" | 42 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
44 #include "chrome/browser/google/google_util.h" | 43 #include "chrome/browser/google/google_util.h" |
45 #include "chrome/browser/guestview/adview/adview_guest.h" | 44 #include "chrome/browser/guestview/adview/adview_guest.h" |
46 #include "chrome/browser/guestview/guestview.h" | 45 #include "chrome/browser/guestview/guestview.h" |
47 #include "chrome/browser/guestview/guestview_constants.h" | 46 #include "chrome/browser/guestview/guestview_constants.h" |
48 #include "chrome/browser/guestview/webview/webview_guest.h" | 47 #include "chrome/browser/guestview/webview/webview_guest.h" |
49 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h" | 48 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 #include "content/public/browser/render_process_host.h" | 117 #include "content/public/browser/render_process_host.h" |
119 #include "content/public/browser/render_view_host.h" | 118 #include "content/public/browser/render_view_host.h" |
120 #include "content/public/browser/resource_context.h" | 119 #include "content/public/browser/resource_context.h" |
121 #include "content/public/browser/site_instance.h" | 120 #include "content/public/browser/site_instance.h" |
122 #include "content/public/browser/web_contents.h" | 121 #include "content/public/browser/web_contents.h" |
123 #include "content/public/browser/web_contents_view.h" | 122 #include "content/public/browser/web_contents_view.h" |
124 #include "content/public/common/child_process_host.h" | 123 #include "content/public/common/child_process_host.h" |
125 #include "content/public/common/content_descriptors.h" | 124 #include "content/public/common/content_descriptors.h" |
126 #include "content/public/common/url_utils.h" | 125 #include "content/public/common/url_utils.h" |
127 #include "extensions/browser/extension_registry.h" | 126 #include "extensions/browser/extension_registry.h" |
| 127 #include "extensions/browser/extension_system.h" |
128 #include "extensions/browser/info_map.h" | 128 #include "extensions/browser/info_map.h" |
129 #include "extensions/browser/process_manager.h" | 129 #include "extensions/browser/process_manager.h" |
130 #include "extensions/browser/process_map.h" | 130 #include "extensions/browser/process_map.h" |
131 #include "extensions/browser/view_type_utils.h" | 131 #include "extensions/browser/view_type_utils.h" |
132 #include "extensions/common/constants.h" | 132 #include "extensions/common/constants.h" |
133 #include "extensions/common/extension.h" | 133 #include "extensions/common/extension.h" |
134 #include "extensions/common/extension_set.h" | 134 #include "extensions/common/extension_set.h" |
135 #include "extensions/common/manifest_handlers/background_info.h" | 135 #include "extensions/common/manifest_handlers/background_info.h" |
136 #include "extensions/common/manifest_handlers/shared_module_info.h" | 136 #include "extensions/common/manifest_handlers/shared_module_info.h" |
137 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" | 137 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 extensions::ExtensionRegistry* extension_registry = | 1343 extensions::ExtensionRegistry* extension_registry = |
1344 extensions::ExtensionRegistry::Get(site_instance->GetBrowserContext()); | 1344 extensions::ExtensionRegistry::Get(site_instance->GetBrowserContext()); |
1345 if (!extension_registry) | 1345 if (!extension_registry) |
1346 return; | 1346 return; |
1347 const Extension* extension = | 1347 const Extension* extension = |
1348 extension_registry->enabled_extensions().GetExtensionOrAppByURL( | 1348 extension_registry->enabled_extensions().GetExtensionOrAppByURL( |
1349 site_instance->GetSiteURL()); | 1349 site_instance->GetSiteURL()); |
1350 if (!extension) | 1350 if (!extension) |
1351 return; | 1351 return; |
1352 extensions::ExtensionSystem* extension_system = | 1352 extensions::ExtensionSystem* extension_system = |
1353 extensions::ExtensionSystem::GetForBrowserContext( | 1353 extensions::ExtensionSystem::Get(site_instance->GetBrowserContext()); |
1354 site_instance->GetBrowserContext()); | |
1355 extension_system->info_map()->RegisterExtensionWorkerProcess( | 1354 extension_system->info_map()->RegisterExtensionWorkerProcess( |
1356 extension->id(), | 1355 extension->id(), |
1357 worker_process_id, | 1356 worker_process_id, |
1358 site_instance->GetId()); | 1357 site_instance->GetId()); |
1359 } | 1358 } |
1360 | 1359 |
1361 void ChromeContentBrowserClient::WorkerProcessTerminated( | 1360 void ChromeContentBrowserClient::WorkerProcessTerminated( |
1362 SiteInstance* site_instance, | 1361 SiteInstance* site_instance, |
1363 int worker_process_id) { | 1362 int worker_process_id) { |
1364 extensions::ExtensionSystem* extension_system = | 1363 extensions::ExtensionSystem* extension_system = |
1365 extensions::ExtensionSystem::GetForBrowserContext( | 1364 extensions::ExtensionSystem::Get(site_instance->GetBrowserContext()); |
1366 site_instance->GetBrowserContext()); | |
1367 extension_system->info_map()->UnregisterExtensionWorkerProcess( | 1365 extension_system->info_map()->UnregisterExtensionWorkerProcess( |
1368 worker_process_id); | 1366 worker_process_id); |
1369 } | 1367 } |
1370 | 1368 |
1371 bool ChromeContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation( | 1369 bool ChromeContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation( |
1372 SiteInstance* site_instance, | 1370 SiteInstance* site_instance, |
1373 const GURL& current_url, | 1371 const GURL& current_url, |
1374 const GURL& new_url) { | 1372 const GURL& new_url) { |
1375 // If we don't have an ExtensionService, then rely on the SiteInstance logic | 1373 // If we don't have an ExtensionService, then rely on the SiteInstance logic |
1376 // in RenderFrameHostManager to decide when to swap. | 1374 // in RenderFrameHostManager to decide when to swap. |
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2703 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on | 2701 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on |
2704 // Chromium builds as well. | 2702 // Chromium builds as well. |
2705 return channel <= chrome::VersionInfo::CHANNEL_DEV; | 2703 return channel <= chrome::VersionInfo::CHANNEL_DEV; |
2706 #else | 2704 #else |
2707 return false; | 2705 return false; |
2708 #endif | 2706 #endif |
2709 } | 2707 } |
2710 | 2708 |
2711 | 2709 |
2712 } // namespace chrome | 2710 } // namespace chrome |
OLD | NEW |