OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/bookmarks/bookmark_client_factory.h" | 5 #include "ios/chrome/browser/bookmarks/bookmark_client_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "components/keyed_service/core/service_access_type.h" | 8 #include "components/keyed_service/core/service_access_type.h" |
9 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 9 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
10 #include "ios/chrome/browser/bookmarks/bookmark_client_impl.h" | 10 #include "ios/chrome/browser/bookmarks/bookmark_client_impl.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // static | 28 // static |
29 BookmarkClientImpl* BookmarkClientFactory::GetForBrowserState( | 29 BookmarkClientImpl* BookmarkClientFactory::GetForBrowserState( |
30 ios::ChromeBrowserState* browser_state) { | 30 ios::ChromeBrowserState* browser_state) { |
31 return static_cast<BookmarkClientImpl*>( | 31 return static_cast<BookmarkClientImpl*>( |
32 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 32 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
33 } | 33 } |
34 | 34 |
35 // static | 35 // static |
36 BookmarkClientFactory* BookmarkClientFactory::GetInstance() { | 36 BookmarkClientFactory* BookmarkClientFactory::GetInstance() { |
37 return Singleton<BookmarkClientFactory>::get(); | 37 return base::Singleton<BookmarkClientFactory>::get(); |
38 } | 38 } |
39 | 39 |
40 // static | 40 // static |
41 BrowserStateKeyedServiceFactory::TestingFactoryFunction | 41 BrowserStateKeyedServiceFactory::TestingFactoryFunction |
42 BookmarkClientFactory::GetDefaultFactory() { | 42 BookmarkClientFactory::GetDefaultFactory() { |
43 return &BuildBookmarkClientImpl; | 43 return &BuildBookmarkClientImpl; |
44 } | 44 } |
45 | 45 |
46 BookmarkClientFactory::BookmarkClientFactory() | 46 BookmarkClientFactory::BookmarkClientFactory() |
47 : BrowserStateKeyedServiceFactory( | 47 : BrowserStateKeyedServiceFactory( |
(...skipping 10 matching lines...) Expand all Loading... |
58 } | 58 } |
59 | 59 |
60 web::BrowserState* BookmarkClientFactory::GetBrowserStateToUse( | 60 web::BrowserState* BookmarkClientFactory::GetBrowserStateToUse( |
61 web::BrowserState* context) const { | 61 web::BrowserState* context) const { |
62 return GetBrowserStateRedirectedInIncognito(context); | 62 return GetBrowserStateRedirectedInIncognito(context); |
63 } | 63 } |
64 | 64 |
65 bool BookmarkClientFactory::ServiceIsNULLWhileTesting() const { | 65 bool BookmarkClientFactory::ServiceIsNULLWhileTesting() const { |
66 return true; | 66 return true; |
67 } | 67 } |
OLD | NEW |