Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc

Issue 168253002: Cleanup many APIs to use ProfileKeyedAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(content::BrowserContext* context) 45 ActivityLogAPI::ActivityLogAPI(content::BrowserContext* context)
46 : browser_context_(context), initialized_(false) { 46 : browser_context_(context), initialized_(false) {
47 if (!ExtensionSystem::Get(browser_context_) 47 if (!ExtensionSystem::Get(browser_context_)
48 ->event_router()) { // Check for testing. 48 ->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(browser_context_); 52 activity_log_ = extensions::ActivityLog::GetInstance(browser_context_);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 gurls.push_back(GURL(*it)); 218 gurls.push_back(GURL(*it));
219 } 219 }
220 220
221 ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile()); 221 ActivityLog* activity_log = ActivityLog::GetInstance(GetProfile());
222 DCHECK(activity_log); 222 DCHECK(activity_log);
223 activity_log->RemoveURLs(gurls); 223 activity_log->RemoveURLs(gurls);
224 return true; 224 return true;
225 } 225 }
226 226
227 } // namespace extensions 227 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698