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/activity_log/activity_log.h" | 5 #include "chrome/browser/extensions/activity_log/activity_log.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 switches::kEnableExtensionActivityLogTesting); | 573 switches::kEnableExtensionActivityLogTesting); |
574 | 574 |
575 // Check if the watchdog extension is previously installed and active. | 575 // Check if the watchdog extension is previously installed and active. |
576 cached_consumer_count_ = | 576 cached_consumer_count_ = |
577 profile_->GetPrefs()->GetInteger(prefs::kWatchdogExtensionActive); | 577 profile_->GetPrefs()->GetInteger(prefs::kWatchdogExtensionActive); |
578 | 578 |
579 observers_ = new base::ObserverListThreadSafe<Observer>; | 579 observers_ = new base::ObserverListThreadSafe<Observer>; |
580 | 580 |
581 // Check that the right threads exist for logging to the database. | 581 // Check that the right threads exist for logging to the database. |
582 // If not, we shouldn't try to do things that require them. | 582 // If not, we shouldn't try to do things that require them. |
| 583 // TODO(devlin): We can clean this up now that we use sequenced task runners. |
583 if (!BrowserThread::IsMessageLoopValid(BrowserThread::DB) || | 584 if (!BrowserThread::IsMessageLoopValid(BrowserThread::DB) || |
584 !BrowserThread::IsMessageLoopValid(BrowserThread::FILE) || | 585 !BrowserThread::IsMessageLoopValid(BrowserThread::FILE) || |
585 !BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { | 586 !BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { |
586 has_threads_ = false; | 587 has_threads_ = false; |
587 } | 588 } |
588 | 589 |
589 extension_registry_observer_.Add(ExtensionRegistry::Get(profile_)); | 590 extension_registry_observer_.Add(ExtensionRegistry::Get(profile_)); |
590 CheckActive(true); // use cached | 591 CheckActive(true); // use cached |
591 extension_system_->ready().Post( | 592 extension_system_->ready().Post( |
592 FROM_HERE, | 593 FROM_HERE, |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 } | 940 } |
940 } | 941 } |
941 | 942 |
942 template <> | 943 template <> |
943 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { | 944 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { |
944 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 945 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
945 DependsOn(ExtensionRegistryFactory::GetInstance()); | 946 DependsOn(ExtensionRegistryFactory::GetInstance()); |
946 } | 947 } |
947 | 948 |
948 } // namespace extensions | 949 } // namespace extensions |
OLD | NEW |