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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 ExtensionService::~ExtensionService() { | 562 ExtensionService::~ExtensionService() { |
563 // No need to unload extensions here because they are profile-scoped, and the | 563 // No need to unload extensions here because they are profile-scoped, and the |
564 // profile is in the process of being deleted. | 564 // profile is in the process of being deleted. |
565 | 565 |
566 ProviderCollection::const_iterator i; | 566 ProviderCollection::const_iterator i; |
567 for (i = external_extension_providers_.begin(); | 567 for (i = external_extension_providers_.begin(); |
568 i != external_extension_providers_.end(); ++i) { | 568 i != external_extension_providers_.end(); ++i) { |
569 ExternalExtensionProviderInterface* provider = i->get(); | 569 ExternalExtensionProviderInterface* provider = i->get(); |
570 provider->ServiceShutdown(); | 570 provider->ServiceShutdown(); |
571 } | 571 } |
572 | |
573 #if defined(OS_CHROMEOS) | |
574 if (event_routers_initialized_) { | |
575 ExtensionFileBrowserEventRouter::GetInstance()-> | |
576 StopObservingFileSystemEvents(); | |
577 } | |
578 #endif | |
579 } | 572 } |
580 | 573 |
581 void ExtensionService::InitEventRouters() { | 574 void ExtensionService::InitEventRouters() { |
582 if (event_routers_initialized_) | 575 if (event_routers_initialized_) |
583 return; | 576 return; |
584 | 577 |
585 ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); | 578 history_event_router_.reset(new ExtensionHistoryEventRouter(profile_)); |
586 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); | 579 history_event_router_->Init(); |
| 580 accessibility_event_router_.reset(new ExtensionAccessibilityEventRouter()); |
| 581 accessibility_event_router_->Init(); |
587 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); | 582 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); |
588 browser_event_router_->Init(); | 583 browser_event_router_->Init(); |
589 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); | 584 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); |
590 ExtensionBookmarkEventRouter::GetInstance()->Observe( | 585 preference_event_router_->Init(); |
591 profile_->GetBookmarkModel()); | 586 bookmark_event_router_.reset(new ExtensionBookmarkEventRouter()); |
592 ExtensionCookiesEventRouter::GetInstance()->Init(); | 587 bookmark_event_router_->Observe(profile_->GetBookmarkModel()); |
593 ExtensionManagementEventRouter::GetInstance()->Init(); | 588 cookies_event_router_.reset(new ExtensionCookiesEventRouter()); |
594 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); | 589 cookies_event_router_->Init(); |
595 ExtensionWebNavigationEventRouter::GetInstance()->Init(); | 590 management_event_router_.reset(new ExtensionManagementEventRouter()); |
| 591 management_event_router_->Init(); |
| 592 processes_event_router_.reset(new ExtensionProcessesEventRouter(profile_)); |
| 593 processes_event_router_->Init(); |
| 594 web_navigation_event_router_.reset(new ExtensionWebNavigationEventRouter()); |
| 595 web_navigation_event_router_->Init(); |
596 | 596 |
597 #if defined(OS_CHROMEOS) | 597 #if defined(OS_CHROMEOS) |
598 ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents( | 598 file_browser_event_router_.reset( |
599 profile_); | 599 new ExtensionFileBrowserEventRouter(profile_)); |
600 #endif | 600 #endif |
601 | 601 |
602 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) | 602 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
603 ExtensionInputUiEventRouter::GetInstance()->Init(); | 603 ExtensionInputUiEventRouter::GetInstance()->Init(); |
604 #endif | 604 #endif |
605 | 605 |
606 event_routers_initialized_ = true; | 606 event_routers_initialized_ = true; |
607 } | 607 } |
608 | 608 |
609 const Extension* ExtensionService::GetExtensionById( | 609 const Extension* ExtensionService::GetExtensionById( |
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 | 2267 |
2268 ExtensionService::NaClModuleInfoList::iterator | 2268 ExtensionService::NaClModuleInfoList::iterator |
2269 ExtensionService::FindNaClModule(const GURL& url) { | 2269 ExtensionService::FindNaClModule(const GURL& url) { |
2270 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2270 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2271 iter != nacl_module_list_.end(); ++iter) { | 2271 iter != nacl_module_list_.end(); ++iter) { |
2272 if (iter->url == url) | 2272 if (iter->url == url) |
2273 return iter; | 2273 return iter; |
2274 } | 2274 } |
2275 return nacl_module_list_.end(); | 2275 return nacl_module_list_.end(); |
2276 } | 2276 } |
OLD | NEW |