OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/extensions/extension_bookmarks_module.h" | 27 #include "chrome/browser/extensions/extension_bookmarks_module.h" |
28 #include "chrome/browser/extensions/extension_browser_event_router.h" | 28 #include "chrome/browser/extensions/extension_browser_event_router.h" |
29 #include "chrome/browser/extensions/extension_cookies_api.h" | 29 #include "chrome/browser/extensions/extension_cookies_api.h" |
30 #include "chrome/browser/extensions/extension_data_deleter.h" | 30 #include "chrome/browser/extensions/extension_data_deleter.h" |
31 #include "chrome/browser/extensions/extension_dom_ui.h" | 31 #include "chrome/browser/extensions/extension_dom_ui.h" |
32 #include "chrome/browser/extensions/extension_error_reporter.h" | 32 #include "chrome/browser/extensions/extension_error_reporter.h" |
33 #include "chrome/browser/extensions/extension_history_api.h" | 33 #include "chrome/browser/extensions/extension_history_api.h" |
34 #include "chrome/browser/extensions/extension_host.h" | 34 #include "chrome/browser/extensions/extension_host.h" |
35 #include "chrome/browser/extensions/extension_management_api.h" | 35 #include "chrome/browser/extensions/extension_management_api.h" |
36 #include "chrome/browser/extensions/extension_process_manager.h" | 36 #include "chrome/browser/extensions/extension_process_manager.h" |
| 37 #include "chrome/browser/extensions/extension_processes_api.h" |
37 #include "chrome/browser/extensions/extension_updater.h" | 38 #include "chrome/browser/extensions/extension_updater.h" |
38 #include "chrome/browser/extensions/extension_webnavigation_api.h" | 39 #include "chrome/browser/extensions/extension_webnavigation_api.h" |
39 #include "chrome/browser/extensions/external_extension_provider.h" | 40 #include "chrome/browser/extensions/external_extension_provider.h" |
40 #include "chrome/browser/extensions/external_pref_extension_provider.h" | 41 #include "chrome/browser/extensions/external_pref_extension_provider.h" |
41 #include "chrome/browser/net/chrome_url_request_context.h" | 42 #include "chrome/browser/net/chrome_url_request_context.h" |
42 #include "chrome/browser/prefs/pref_service.h" | 43 #include "chrome/browser/prefs/pref_service.h" |
43 #include "chrome/browser/profile.h" | 44 #include "chrome/browser/profile.h" |
44 #include "chrome/browser/search_engines/template_url_model.h" | 45 #include "chrome/browser/search_engines/template_url_model.h" |
45 #include "chrome/browser/sync/glue/extension_sync_traits.h" | 46 #include "chrome/browser/sync/glue/extension_sync_traits.h" |
46 #include "chrome/browser/sync/glue/extension_util.h" | 47 #include "chrome/browser/sync/glue/extension_util.h" |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } | 609 } |
609 | 610 |
610 void ExtensionsService::InitEventRouters() { | 611 void ExtensionsService::InitEventRouters() { |
611 ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); | 612 ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); |
612 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); | 613 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); |
613 ExtensionBrowserEventRouter::GetInstance()->Init(profile_); | 614 ExtensionBrowserEventRouter::GetInstance()->Init(profile_); |
614 ExtensionBookmarkEventRouter::GetSingleton()->Observe( | 615 ExtensionBookmarkEventRouter::GetSingleton()->Observe( |
615 profile_->GetBookmarkModel()); | 616 profile_->GetBookmarkModel()); |
616 ExtensionCookiesEventRouter::GetInstance()->Init(); | 617 ExtensionCookiesEventRouter::GetInstance()->Init(); |
617 ExtensionManagementEventRouter::GetInstance()->Init(); | 618 ExtensionManagementEventRouter::GetInstance()->Init(); |
| 619 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); |
618 ExtensionWebNavigationEventRouter::GetInstance()->Init(); | 620 ExtensionWebNavigationEventRouter::GetInstance()->Init(); |
619 } | 621 } |
620 | 622 |
621 void ExtensionsService::Init() { | 623 void ExtensionsService::Init() { |
622 DCHECK(!ready_); | 624 DCHECK(!ready_); |
623 DCHECK_EQ(extensions_.size(), 0u); | 625 DCHECK_EQ(extensions_.size(), 0u); |
624 | 626 |
625 // Hack: we need to ensure the ResourceDispatcherHost is ready before we load | 627 // Hack: we need to ensure the ResourceDispatcherHost is ready before we load |
626 // the first extension, because its members listen for loaded notifications. | 628 // the first extension, because its members listen for loaded notifications. |
627 g_browser_process->resource_dispatcher_host(); | 629 g_browser_process->resource_dispatcher_host(); |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 return false; | 1782 return false; |
1781 | 1783 |
1782 for (ExtensionList::const_iterator it = extensions_.begin(); | 1784 for (ExtensionList::const_iterator it = extensions_.begin(); |
1783 it != extensions_.end(); ++it) { | 1785 it != extensions_.end(); ++it) { |
1784 if ((*it)->is_app()) | 1786 if ((*it)->is_app()) |
1785 return true; | 1787 return true; |
1786 } | 1788 } |
1787 | 1789 |
1788 return false; | 1790 return false; |
1789 } | 1791 } |
OLD | NEW |