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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | |
Erik does not do reviews
2011/01/12 00:31:54
I don't see anything new that uses this.
asargent_no_longer_on_chrome
2011/01/13 21:34:07
There's existing code that uses it - I noticed a w
| |
8 | 9 |
9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
11 #include "base/file_util.h" | 12 #include "base/file_util.h" |
12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
13 #include "base/stl_util-inl.h" | 14 #include "base/stl_util-inl.h" |
14 #include "base/string16.h" | 15 #include "base/string16.h" |
15 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
17 #include "base/stringprintf.h" | 18 #include "base/stringprintf.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 updater_->Stop(); | 619 updater_->Stop(); |
619 } | 620 } |
620 } | 621 } |
621 | 622 |
622 void ExtensionService::InitEventRouters() { | 623 void ExtensionService::InitEventRouters() { |
623 if (event_routers_initialized_) | 624 if (event_routers_initialized_) |
624 return; | 625 return; |
625 | 626 |
626 ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); | 627 ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_); |
627 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); | 628 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); |
628 ExtensionBrowserEventRouter::GetInstance()->Init(profile_); | 629 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); |
630 browser_event_router_->Init(); | |
629 ExtensionBookmarkEventRouter::GetInstance()->Observe( | 631 ExtensionBookmarkEventRouter::GetInstance()->Observe( |
630 profile_->GetBookmarkModel()); | 632 profile_->GetBookmarkModel()); |
631 ExtensionCookiesEventRouter::GetInstance()->Init(); | 633 ExtensionCookiesEventRouter::GetInstance()->Init(); |
632 ExtensionManagementEventRouter::GetInstance()->Init(); | 634 ExtensionManagementEventRouter::GetInstance()->Init(); |
633 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); | 635 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); |
634 ExtensionWebNavigationEventRouter::GetInstance()->Init(); | 636 ExtensionWebNavigationEventRouter::GetInstance()->Init(); |
635 event_routers_initialized_ = true; | 637 event_routers_initialized_ = true; |
636 } | 638 } |
637 | 639 |
638 const Extension* ExtensionService::GetExtensionById(const std::string& id, | 640 const Extension* ExtensionService::GetExtensionById(const std::string& id, |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1373 } | 1375 } |
1374 | 1376 |
1375 // UnloadExtension will change the extensions_ list. So, we should | 1377 // UnloadExtension will change the extensions_ list. So, we should |
1376 // call it outside the iterator loop. | 1378 // call it outside the iterator loop. |
1377 for (unsigned int i = 0; i < to_be_removed.size(); ++i) { | 1379 for (unsigned int i = 0; i < to_be_removed.size(); ++i) { |
1378 UnloadExtension(to_be_removed[i], UnloadedExtensionInfo::DISABLE); | 1380 UnloadExtension(to_be_removed[i], UnloadedExtensionInfo::DISABLE); |
1379 } | 1381 } |
1380 } | 1382 } |
1381 | 1383 |
1382 void ExtensionService::DestroyingProfile() { | 1384 void ExtensionService::DestroyingProfile() { |
1385 browser_event_router_.reset(); | |
1383 pref_change_registrar_.RemoveAll(); | 1386 pref_change_registrar_.RemoveAll(); |
1384 profile_ = NULL; | 1387 profile_ = NULL; |
1385 toolbar_model_.DestroyingProfile(); | 1388 toolbar_model_.DestroyingProfile(); |
1386 } | 1389 } |
1387 | 1390 |
1388 ExtensionPrefs* ExtensionService::extension_prefs() { | 1391 ExtensionPrefs* ExtensionService::extension_prefs() { |
1389 return extension_prefs_; | 1392 return extension_prefs_; |
1390 } | 1393 } |
1391 | 1394 |
1392 void ExtensionService::CheckAdminBlacklist() { | 1395 void ExtensionService::CheckAdminBlacklist() { |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2066 } | 2069 } |
2067 | 2070 |
2068 void ExtensionService::SetBeingUpgraded(const Extension* extension, | 2071 void ExtensionService::SetBeingUpgraded(const Extension* extension, |
2069 bool value) { | 2072 bool value) { |
2070 extension_runtime_data_[extension->id()].being_upgraded = value; | 2073 extension_runtime_data_[extension->id()].being_upgraded = value; |
2071 } | 2074 } |
2072 | 2075 |
2073 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { | 2076 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { |
2074 return &extension_runtime_data_[extension->id()].property_bag; | 2077 return &extension_runtime_data_[extension->id()].property_bag; |
2075 } | 2078 } |
OLD | NEW |