OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 6 |
| 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/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 11 |
| 12 // static |
| 13 BookmarkUndoService* BookmarkUndoServiceFactory::GetForProfile( |
| 14 Profile* profile) { |
| 15 return static_cast<BookmarkUndoService*>( |
| 16 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 17 } |
| 18 |
| 19 // static |
| 20 BookmarkUndoServiceFactory* BookmarkUndoServiceFactory::GetInstance() { |
| 21 return Singleton<BookmarkUndoServiceFactory>::get(); |
| 22 } |
| 23 |
| 24 BookmarkUndoServiceFactory::BookmarkUndoServiceFactory() |
| 25 : BrowserContextKeyedServiceFactory( |
| 26 "BookmarkUndoService", |
| 27 BrowserContextDependencyManager::GetInstance()) { |
| 28 DependsOn(BookmarkModelFactory::GetInstance()); |
| 29 } |
| 30 |
| 31 BookmarkUndoServiceFactory::~BookmarkUndoServiceFactory() { |
| 32 } |
| 33 |
| 34 BrowserContextKeyedService* BookmarkUndoServiceFactory::BuildServiceInstanceFor( |
| 35 content::BrowserContext* context) const { |
| 36 Profile* profile = static_cast<Profile*>(context); |
| 37 return new BookmarkUndoService(profile); |
| 38 } |
OLD | NEW |