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

Side by Side Diff: chrome/browser/undo/bookmark_undo_service_factory.cc

Issue 1059523005: Remove dependency on //chrome from bookmark_undo_utils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: Created 5 years, 8 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
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/undo/bookmark_undo_service_factory.h" 5 #include "chrome/browser/undo/bookmark_undo_service_factory.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/undo/bookmark_undo_service.h" 8 #include "chrome/browser/undo/bookmark_undo_service.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 10
11 // static 11 // static
12 BookmarkUndoService* BookmarkUndoServiceFactory::GetForProfile( 12 BookmarkUndoService* BookmarkUndoServiceFactory::GetForProfile(
13 Profile* profile) { 13 Profile* profile) {
14 return static_cast<BookmarkUndoService*>( 14 return static_cast<BookmarkUndoService*>(
15 GetInstance()->GetServiceForBrowserContext(profile, true)); 15 GetInstance()->GetServiceForBrowserContext(profile, true));
16 } 16 }
17 17
18 // static 18 // static
19 BookmarkUndoService* BookmarkUndoServiceFactory::GetForProfileIfExists(
20 Profile* profile) {
21 return static_cast<BookmarkUndoService*>(
22 GetInstance()->GetServiceForBrowserContext(profile, false));
23 }
24
25 // static
19 BookmarkUndoServiceFactory* BookmarkUndoServiceFactory::GetInstance() { 26 BookmarkUndoServiceFactory* BookmarkUndoServiceFactory::GetInstance() {
20 return Singleton<BookmarkUndoServiceFactory>::get(); 27 return Singleton<BookmarkUndoServiceFactory>::get();
21 } 28 }
22 29
23 BookmarkUndoServiceFactory::BookmarkUndoServiceFactory() 30 BookmarkUndoServiceFactory::BookmarkUndoServiceFactory()
24 : BrowserContextKeyedServiceFactory( 31 : BrowserContextKeyedServiceFactory(
25 "BookmarkUndoService", 32 "BookmarkUndoService",
26 BrowserContextDependencyManager::GetInstance()) { 33 BrowserContextDependencyManager::GetInstance()) {
27 } 34 }
28 35
29 BookmarkUndoServiceFactory::~BookmarkUndoServiceFactory() { 36 BookmarkUndoServiceFactory::~BookmarkUndoServiceFactory() {
30 } 37 }
31 38
32 KeyedService* BookmarkUndoServiceFactory::BuildServiceInstanceFor( 39 KeyedService* BookmarkUndoServiceFactory::BuildServiceInstanceFor(
33 content::BrowserContext* context) const { 40 content::BrowserContext* context) const {
34 return new BookmarkUndoService; 41 return new BookmarkUndoService;
35 } 42 }
OLDNEW
« no previous file with comments | « chrome/browser/undo/bookmark_undo_service_factory.h ('k') | chrome/browser/undo/bookmark_undo_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698