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

Side by Side Diff: chrome/browser/extensions/api/history/history_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, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/history/history_api.h" 5 #include "chrome/browser/extensions/api/history/history_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 static base::LazyInstance<ProfileKeyedAPIFactory<HistoryAPI> > 219 static base::LazyInstance<ProfileKeyedAPIFactory<HistoryAPI> >
220 g_factory = LAZY_INSTANCE_INITIALIZER; 220 g_factory = LAZY_INSTANCE_INITIALIZER;
221 221
222 // static 222 // static
223 ProfileKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() { 223 ProfileKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() {
224 return g_factory.Pointer(); 224 return g_factory.Pointer();
225 } 225 }
226 226
227 template<> 227 template<>
228 void ProfileKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() { 228 void ProfileKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() {
229 DependsOn(ActivityLogFactory::GetInstance()); 229 DependsOn(ActivityLog::GetFactoryInstance());
230 } 230 }
231 231
232 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { 232 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) {
233 history_event_router_.reset( 233 history_event_router_.reset(
234 new HistoryEventRouter(Profile::FromBrowserContext(browser_context_))); 234 new HistoryEventRouter(Profile::FromBrowserContext(browser_context_)));
235 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( 235 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver(
236 this); 236 this);
237 } 237 }
238 238
239 void HistoryFunction::Run() { 239 void HistoryFunction::Run() {
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 482 }
483 483
484 return true; 484 return true;
485 } 485 }
486 486
487 void HistoryDeleteAllFunction::DeleteComplete() { 487 void HistoryDeleteAllFunction::DeleteComplete() {
488 SendAsyncResponse(); 488 SendAsyncResponse();
489 } 489 }
490 490
491 } // namespace extensions 491 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698