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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #include "chrome/common/chrome_notification_types.h" | 86 #include "chrome/common/chrome_notification_types.h" |
87 #include "chrome/common/chrome_paths.h" | 87 #include "chrome/common/chrome_paths.h" |
88 #include "chrome/common/chrome_switches.h" | 88 #include "chrome/common/chrome_switches.h" |
89 #include "chrome/common/chrome_version_info.h" | 89 #include "chrome/common/chrome_version_info.h" |
90 #include "chrome/common/extensions/extension.h" | 90 #include "chrome/common/extensions/extension.h" |
91 #include "chrome/common/extensions/extension_error_utils.h" | 91 #include "chrome/common/extensions/extension_error_utils.h" |
92 #include "chrome/common/extensions/extension_file_util.h" | 92 #include "chrome/common/extensions/extension_file_util.h" |
93 #include "chrome/common/extensions/extension_manifest_constants.h" | 93 #include "chrome/common/extensions/extension_manifest_constants.h" |
94 #include "chrome/common/extensions/extension_messages.h" | 94 #include "chrome/common/extensions/extension_messages.h" |
95 #include "chrome/common/extensions/extension_resource.h" | 95 #include "chrome/common/extensions/extension_resource.h" |
| 96 #include "chrome/common/extensions/features/feature.h" |
96 #include "chrome/common/pref_names.h" | 97 #include "chrome/common/pref_names.h" |
97 #include "chrome/common/url_constants.h" | 98 #include "chrome/common/url_constants.h" |
98 #include "content/public/browser/browser_thread.h" | 99 #include "content/public/browser/browser_thread.h" |
99 #include "content/public/browser/devtools_agent_host_registry.h" | 100 #include "content/public/browser/devtools_agent_host_registry.h" |
100 #include "content/public/browser/devtools_manager.h" | 101 #include "content/public/browser/devtools_manager.h" |
101 #include "content/public/browser/notification_service.h" | 102 #include "content/public/browser/notification_service.h" |
102 #include "content/public/browser/notification_types.h" | 103 #include "content/public/browser/notification_types.h" |
103 #include "content/public/browser/plugin_service.h" | 104 #include "content/public/browser/plugin_service.h" |
104 #include "content/public/browser/render_process_host.h" | 105 #include "content/public/browser/render_process_host.h" |
105 #include "content/public/common/pepper_plugin_info.h" | 106 #include "content/public/common/pepper_plugin_info.h" |
(...skipping 2255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 case content::NOTIFICATION_RENDERER_PROCESS_CREATED: { | 2362 case content::NOTIFICATION_RENDERER_PROCESS_CREATED: { |
2362 content::RenderProcessHost* process = | 2363 content::RenderProcessHost* process = |
2363 content::Source<content::RenderProcessHost>(source).ptr(); | 2364 content::Source<content::RenderProcessHost>(source).ptr(); |
2364 Profile* host_profile = | 2365 Profile* host_profile = |
2365 Profile::FromBrowserContext(process->GetBrowserContext()); | 2366 Profile::FromBrowserContext(process->GetBrowserContext()); |
2366 if (!profile_->IsSameProfile(host_profile->GetOriginalProfile())) | 2367 if (!profile_->IsSameProfile(host_profile->GetOriginalProfile())) |
2367 break; | 2368 break; |
2368 | 2369 |
2369 // Extensions need to know the channel for API restrictions. | 2370 // Extensions need to know the channel for API restrictions. |
2370 process->Send(new ExtensionMsg_SetChannel( | 2371 process->Send(new ExtensionMsg_SetChannel( |
2371 chrome::VersionInfo::GetChannel())); | 2372 extensions::Feature::GetCurrentChannel())); |
2372 | 2373 |
2373 // Valid extension function names, used to setup bindings in renderer. | 2374 // Valid extension function names, used to setup bindings in renderer. |
2374 std::vector<std::string> function_names; | 2375 std::vector<std::string> function_names; |
2375 ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names); | 2376 ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names); |
2376 process->Send(new ExtensionMsg_SetFunctionNames(function_names)); | 2377 process->Send(new ExtensionMsg_SetFunctionNames(function_names)); |
2377 | 2378 |
2378 // Scripting whitelist. This is modified by tests and must be communicated | 2379 // Scripting whitelist. This is modified by tests and must be communicated |
2379 // to renderers. | 2380 // to renderers. |
2380 process->Send(new ExtensionMsg_SetScriptingWhitelist( | 2381 process->Send(new ExtensionMsg_SetScriptingWhitelist( |
2381 *Extension::GetScriptingWhitelist())); | 2382 *Extension::GetScriptingWhitelist())); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2562 | 2563 |
2563 // To coexist with certain unit tests that don't have a work-thread message | 2564 // To coexist with certain unit tests that don't have a work-thread message |
2564 // loop available at ExtensionService shutdown, we lazy-initialize this | 2565 // loop available at ExtensionService shutdown, we lazy-initialize this |
2565 // object so that those cases neither create nor destroy an | 2566 // object so that those cases neither create nor destroy an |
2566 // APIResourceController. | 2567 // APIResourceController. |
2567 if (!api_resource_controller_.get()) { | 2568 if (!api_resource_controller_.get()) { |
2568 api_resource_controller_.reset(new extensions::APIResourceController()); | 2569 api_resource_controller_.reset(new extensions::APIResourceController()); |
2569 } | 2570 } |
2570 return api_resource_controller_.get(); | 2571 return api_resource_controller_.get(); |
2571 } | 2572 } |
OLD | NEW |