| 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 ExtensionBrowserEventRouter::GetInstance()->Init(profile_); | 622 ExtensionBrowserEventRouter::GetInstance()->Init(profile_); |
| 623 ExtensionBookmarkEventRouter::GetSingleton()->Observe( | 623 ExtensionBookmarkEventRouter::GetSingleton()->Observe( |
| 624 profile_->GetBookmarkModel()); | 624 profile_->GetBookmarkModel()); |
| 625 ExtensionCookiesEventRouter::GetInstance()->Init(); | 625 ExtensionCookiesEventRouter::GetInstance()->Init(); |
| 626 ExtensionManagementEventRouter::GetInstance()->Init(); | 626 ExtensionManagementEventRouter::GetInstance()->Init(); |
| 627 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); | 627 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); |
| 628 ExtensionWebNavigationEventRouter::GetInstance()->Init(); | 628 ExtensionWebNavigationEventRouter::GetInstance()->Init(); |
| 629 event_routers_initialized_ = true; | 629 event_routers_initialized_ = true; |
| 630 } | 630 } |
| 631 | 631 |
| 632 const Extension* ExtensionsService::GetExtensionById(const std::string& id, |
| 633 bool include_disabled) { |
| 634 return GetExtensionByIdInternal(id, true, include_disabled); |
| 635 } |
| 636 |
| 632 void ExtensionsService::Init() { | 637 void ExtensionsService::Init() { |
| 633 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 638 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 634 | 639 |
| 635 DCHECK(!ready_); // Can't redo init. | 640 DCHECK(!ready_); // Can't redo init. |
| 636 DCHECK_EQ(extensions_.size(), 0u); | 641 DCHECK_EQ(extensions_.size(), 0u); |
| 637 | 642 |
| 638 // Hack: we need to ensure the ResourceDispatcherHost is ready before we load | 643 // Hack: we need to ensure the ResourceDispatcherHost is ready before we load |
| 639 // the first extension, because its members listen for loaded notifications. | 644 // the first extension, because its members listen for loaded notifications. |
| 640 g_browser_process->resource_dispatcher_host(); | 645 g_browser_process->resource_dispatcher_host(); |
| 641 | 646 |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2080 } | 2085 } |
| 2081 | 2086 |
| 2082 void ExtensionsService::SetBeingUpgraded(const Extension* extension, | 2087 void ExtensionsService::SetBeingUpgraded(const Extension* extension, |
| 2083 bool value) { | 2088 bool value) { |
| 2084 extension_runtime_data_[extension->id()].being_upgraded = value; | 2089 extension_runtime_data_[extension->id()].being_upgraded = value; |
| 2085 } | 2090 } |
| 2086 | 2091 |
| 2087 PropertyBag* ExtensionsService::GetPropertyBag(const Extension* extension) { | 2092 PropertyBag* ExtensionsService::GetPropertyBag(const Extension* extension) { |
| 2088 return &extension_runtime_data_[extension->id()].property_bag; | 2093 return &extension_runtime_data_[extension->id()].property_bag; |
| 2089 } | 2094 } |
| OLD | NEW |