OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 Details<const Extension>(extension)); | 1378 Details<const Extension>(extension)); |
1379 | 1379 |
1380 // Tell renderers about the new extension. | 1380 // Tell renderers about the new extension. |
1381 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 1381 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
1382 !i.IsAtEnd(); i.Advance()) { | 1382 !i.IsAtEnd(); i.Advance()) { |
1383 RenderProcessHost* host = i.GetCurrentValue(); | 1383 RenderProcessHost* host = i.GetCurrentValue(); |
1384 Profile* host_profile = | 1384 Profile* host_profile = |
1385 Profile::FromBrowserContext(host->browser_context()); | 1385 Profile::FromBrowserContext(host->browser_context()); |
1386 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) { | 1386 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) { |
1387 host->Send( | 1387 host->Send( |
1388 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params( | 1388 new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(extension))); |
1389 extension, extension->GetActivePermissions()))); | |
1390 } | 1389 } |
1391 } | 1390 } |
1392 | 1391 |
1393 // Tell a random-ass collection of other subsystems about the new extension. | 1392 // Tell a random-ass collection of other subsystems about the new extension. |
1394 // TODO(aa): What should we do with all this goop? Can it move into the | 1393 // TODO(aa): What should we do with all this goop? Can it move into the |
1395 // relevant objects via EXTENSION_LOADED? | 1394 // relevant objects via EXTENSION_LOADED? |
1396 | 1395 |
1397 profile_->GetExtensionSpecialStoragePolicy()-> | 1396 profile_->GetExtensionSpecialStoragePolicy()-> |
1398 GrantRightsForExtension(extension); | 1397 GrantRightsForExtension(extension); |
1399 | 1398 |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2439 process->Send(new ExtensionMsg_SetFunctionNames(function_names)); | 2438 process->Send(new ExtensionMsg_SetFunctionNames(function_names)); |
2440 | 2439 |
2441 // Scripting whitelist. This is modified by tests and must be communicated | 2440 // Scripting whitelist. This is modified by tests and must be communicated |
2442 // to renderers. | 2441 // to renderers. |
2443 process->Send(new ExtensionMsg_SetScriptingWhitelist( | 2442 process->Send(new ExtensionMsg_SetScriptingWhitelist( |
2444 *Extension::GetScriptingWhitelist())); | 2443 *Extension::GetScriptingWhitelist())); |
2445 | 2444 |
2446 // Loaded extensions. | 2445 // Loaded extensions. |
2447 for (size_t i = 0; i < extensions_.size(); ++i) { | 2446 for (size_t i = 0; i < extensions_.size(); ++i) { |
2448 process->Send(new ExtensionMsg_Loaded( | 2447 process->Send(new ExtensionMsg_Loaded( |
2449 ExtensionMsg_Loaded_Params( | 2448 ExtensionMsg_Loaded_Params(extensions_[i]))); |
2450 extensions_[i], extensions_[i]->GetActivePermissions()))); | |
2451 } | 2449 } |
2452 break; | 2450 break; |
2453 } | 2451 } |
2454 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: { | 2452 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: { |
2455 RenderProcessHost* process = Source<RenderProcessHost>(source).ptr(); | 2453 RenderProcessHost* process = Source<RenderProcessHost>(source).ptr(); |
2456 installed_app_hosts_.erase(process->id()); | 2454 installed_app_hosts_.erase(process->id()); |
2457 break; | 2455 break; |
2458 } | 2456 } |
2459 case chrome::NOTIFICATION_PREF_CHANGED: { | 2457 case chrome::NOTIFICATION_PREF_CHANGED: { |
2460 std::string* pref_name = Details<std::string>(details).ptr(); | 2458 std::string* pref_name = Details<std::string>(details).ptr(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2588 | 2586 |
2589 ExtensionService::NaClModuleInfoList::iterator | 2587 ExtensionService::NaClModuleInfoList::iterator |
2590 ExtensionService::FindNaClModule(const GURL& url) { | 2588 ExtensionService::FindNaClModule(const GURL& url) { |
2591 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2589 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2592 iter != nacl_module_list_.end(); ++iter) { | 2590 iter != nacl_module_list_.end(); ++iter) { |
2593 if (iter->url == url) | 2591 if (iter->url == url) |
2594 return iter; | 2592 return iter; |
2595 } | 2593 } |
2596 return nacl_module_list_.end(); | 2594 return nacl_module_list_.end(); |
2597 } | 2595 } |
OLD | NEW |