| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/api/activity_log_private/activity_log_privat
e_api.h" | 5 #include "chrome/browser/extensions/api/activity_log_private/activity_log_privat
e_api.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 g_factory = LAZY_INSTANCE_INITIALIZER; | 32 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 33 | 33 |
| 34 // static | 34 // static |
| 35 ProfileKeyedAPIFactory<ActivityLogAPI>* ActivityLogAPI::GetFactoryInstance() { | 35 ProfileKeyedAPIFactory<ActivityLogAPI>* ActivityLogAPI::GetFactoryInstance() { |
| 36 return g_factory.Pointer(); | 36 return g_factory.Pointer(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 template<> | 39 template<> |
| 40 void ProfileKeyedAPIFactory<ActivityLogAPI>::DeclareFactoryDependencies() { | 40 void ProfileKeyedAPIFactory<ActivityLogAPI>::DeclareFactoryDependencies() { |
| 41 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 41 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 42 DependsOn(ActivityLogFactory::GetInstance()); | 42 DependsOn(ActivityLog::GetFactoryInstance()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 ActivityLogAPI::ActivityLogAPI(Profile* profile) | 45 ActivityLogAPI::ActivityLogAPI(Profile* profile) |
| 46 : profile_(profile), | 46 : profile_(profile), |
| 47 initialized_(false) { | 47 initialized_(false) { |
| 48 if (!ExtensionSystem::Get(profile_)->event_router()) { // Check for testing. | 48 if (!ExtensionSystem::Get(profile_)->event_router()) { // Check for testing. |
| 49 DVLOG(1) << "ExtensionSystem event_router does not exist."; | 49 DVLOG(1) << "ExtensionSystem event_router does not exist."; |
| 50 return; | 50 return; |
| 51 } | 51 } |
| 52 activity_log_ = extensions::ActivityLog::GetInstance(profile_); | 52 activity_log_ = extensions::ActivityLog::GetInstance(profile_); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 gurls.push_back(GURL(*it)); | 216 gurls.push_back(GURL(*it)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); | 219 ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); |
| 220 DCHECK(activity_log); | 220 DCHECK(activity_log); |
| 221 activity_log->RemoveURLs(gurls); | 221 activity_log->RemoveURLs(gurls); |
| 222 return true; | 222 return true; |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace extensions | 225 } // namespace extensions |
| OLD | NEW |