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 10 matching lines...) Expand all Loading... |
21 #include "extensions/common/features/feature_provider.h" | 21 #include "extensions/common/features/feature_provider.h" |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 | 24 |
25 namespace activity_log_private = api::activity_log_private; | 25 namespace activity_log_private = api::activity_log_private; |
26 | 26 |
27 using api::activity_log_private::ActivityResultSet; | 27 using api::activity_log_private::ActivityResultSet; |
28 using api::activity_log_private::ExtensionActivity; | 28 using api::activity_log_private::ExtensionActivity; |
29 using api::activity_log_private::Filter; | 29 using api::activity_log_private::Filter; |
30 | 30 |
31 static base::LazyInstance<ProfileKeyedAPIFactory<ActivityLogAPI> > | 31 static base::LazyInstance<BrowserContextKeyedAPIFactory<ActivityLogAPI> > |
32 g_factory = LAZY_INSTANCE_INITIALIZER; | 32 g_factory = LAZY_INSTANCE_INITIALIZER; |
33 | 33 |
34 // static | 34 // static |
35 ProfileKeyedAPIFactory<ActivityLogAPI>* ActivityLogAPI::GetFactoryInstance() { | 35 BrowserContextKeyedAPIFactory<ActivityLogAPI>* |
| 36 ActivityLogAPI::GetFactoryInstance() { |
36 return g_factory.Pointer(); | 37 return g_factory.Pointer(); |
37 } | 38 } |
38 | 39 |
39 template<> | 40 template <> |
40 void ProfileKeyedAPIFactory<ActivityLogAPI>::DeclareFactoryDependencies() { | 41 void |
| 42 BrowserContextKeyedAPIFactory<ActivityLogAPI>::DeclareFactoryDependencies() { |
41 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 43 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
42 DependsOn(ActivityLog::GetFactoryInstance()); | 44 DependsOn(ActivityLog::GetFactoryInstance()); |
43 } | 45 } |
44 | 46 |
45 ActivityLogAPI::ActivityLogAPI(content::BrowserContext* context) | 47 ActivityLogAPI::ActivityLogAPI(content::BrowserContext* context) |
46 : browser_context_(context), initialized_(false) { | 48 : browser_context_(context), initialized_(false) { |
47 if (!ExtensionSystem::Get(browser_context_) | 49 if (!ExtensionSystem::Get(browser_context_) |
48 ->event_router()) { // Check for testing. | 50 ->event_router()) { // Check for testing. |
49 DVLOG(1) << "ExtensionSystem event_router does not exist."; | 51 DVLOG(1) << "ExtensionSystem event_router does not exist."; |
50 return; | 52 return; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 gurls.push_back(GURL(*it)); | 220 gurls.push_back(GURL(*it)); |
219 } | 221 } |
220 | 222 |
221 ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); | 223 ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); |
222 DCHECK(activity_log); | 224 DCHECK(activity_log); |
223 activity_log->RemoveURLs(gurls); | 225 activity_log->RemoveURLs(gurls); |
224 return true; | 226 return true; |
225 } | 227 } |
226 | 228 |
227 } // namespace extensions | 229 } // namespace extensions |
OLD | NEW |