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
3 // found in the LICENSE file.
5 #include "chrome/browser/undo/bookmark_undo_service_factory.h"
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/undo/bookmark_undo_service.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 BookmarkUndoService
* BookmarkUndoServiceFactory::GetForProfile(
15 return static_cast<BookmarkUndoService
*>(
16 GetInstance()->GetServiceForBrowserContext(profile
, true));
20 BookmarkUndoServiceFactory
* BookmarkUndoServiceFactory::GetInstance() {
21 return Singleton
<BookmarkUndoServiceFactory
>::get();
24 BookmarkUndoServiceFactory::BookmarkUndoServiceFactory()
25 : BrowserContextKeyedServiceFactory(
26 "BookmarkUndoService",
27 BrowserContextDependencyManager::GetInstance()) {
28 DependsOn(BookmarkModelFactory::GetInstance());
31 BookmarkUndoServiceFactory::~BookmarkUndoServiceFactory() {
34 KeyedService
* BookmarkUndoServiceFactory::BuildServiceInstanceFor(
35 content::BrowserContext
* context
) const {
36 Profile
* profile
= static_cast<Profile
*>(context
);
37 return new BookmarkUndoService(profile
);