| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bookmarks/chrome_bookmark_client_factory.h" | 5 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 8 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
| 9 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" | 9 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" |
| 10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // static | 26 // static |
| 27 ChromeBookmarkClient* ChromeBookmarkClientFactory::GetForProfile( | 27 ChromeBookmarkClient* ChromeBookmarkClientFactory::GetForProfile( |
| 28 Profile* profile) { | 28 Profile* profile) { |
| 29 return static_cast<ChromeBookmarkClient*>( | 29 return static_cast<ChromeBookmarkClient*>( |
| 30 GetInstance()->GetServiceForBrowserContext(profile, true)); | 30 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 // static | 33 // static |
| 34 ChromeBookmarkClientFactory* ChromeBookmarkClientFactory::GetInstance() { | 34 ChromeBookmarkClientFactory* ChromeBookmarkClientFactory::GetInstance() { |
| 35 return Singleton<ChromeBookmarkClientFactory>::get(); | 35 return base::Singleton<ChromeBookmarkClientFactory>::get(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // static | 38 // static |
| 39 BrowserContextKeyedServiceFactory::TestingFactoryFunction | 39 BrowserContextKeyedServiceFactory::TestingFactoryFunction |
| 40 ChromeBookmarkClientFactory::GetDefaultFactory() { | 40 ChromeBookmarkClientFactory::GetDefaultFactory() { |
| 41 return &BuildChromeBookmarkClient; | 41 return &BuildChromeBookmarkClient; |
| 42 } | 42 } |
| 43 | 43 |
| 44 ChromeBookmarkClientFactory::ChromeBookmarkClientFactory() | 44 ChromeBookmarkClientFactory::ChromeBookmarkClientFactory() |
| 45 : BrowserContextKeyedServiceFactory( | 45 : BrowserContextKeyedServiceFactory( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 content::BrowserContext* ChromeBookmarkClientFactory::GetBrowserContextToUse( | 59 content::BrowserContext* ChromeBookmarkClientFactory::GetBrowserContextToUse( |
| 60 content::BrowserContext* context) const { | 60 content::BrowserContext* context) const { |
| 61 return chrome::GetBrowserContextRedirectedInIncognito(context); | 61 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool ChromeBookmarkClientFactory::ServiceIsNULLWhileTesting() const { | 64 bool ChromeBookmarkClientFactory::ServiceIsNULLWhileTesting() const { |
| 65 return true; | 65 return true; |
| 66 } | 66 } |
| OLD | NEW |