| 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/enhanced_bookmarks/enhanced_bookmark_model_factory.
h" | 5 #include "ios/chrome/browser/enhanced_bookmarks/enhanced_bookmark_model_factory.
h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h" | 8 #include "components/enhanced_bookmarks/enhanced_bookmark_model.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 "components/version_info/version_info.h" | 10 #include "components/version_info/version_info.h" |
| 11 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" |
| 12 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" | 12 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" |
| 13 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | 13 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" |
| 14 | 14 |
| 15 namespace enhanced_bookmarks { | 15 namespace enhanced_bookmarks { |
| 16 | 16 |
| 17 // static | 17 // static |
| 18 EnhancedBookmarkModelFactory* EnhancedBookmarkModelFactory::GetInstance() { | 18 EnhancedBookmarkModelFactory* EnhancedBookmarkModelFactory::GetInstance() { |
| 19 return Singleton<EnhancedBookmarkModelFactory>::get(); | 19 return base::Singleton<EnhancedBookmarkModelFactory>::get(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 // static | 22 // static |
| 23 EnhancedBookmarkModel* EnhancedBookmarkModelFactory::GetForBrowserState( | 23 EnhancedBookmarkModel* EnhancedBookmarkModelFactory::GetForBrowserState( |
| 24 ios::ChromeBrowserState* browser_state) { | 24 ios::ChromeBrowserState* browser_state) { |
| 25 return static_cast<EnhancedBookmarkModel*>( | 25 return static_cast<EnhancedBookmarkModel*>( |
| 26 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 26 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
| 27 } | 27 } |
| 28 | 28 |
| 29 EnhancedBookmarkModelFactory::EnhancedBookmarkModelFactory() | 29 EnhancedBookmarkModelFactory::EnhancedBookmarkModelFactory() |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 ios::BookmarkModelFactory::GetForBrowserState(browser_state), | 45 ios::BookmarkModelFactory::GetForBrowserState(browser_state), |
| 46 "chrome." + version_info::GetVersionNumber())); | 46 "chrome." + version_info::GetVersionNumber())); |
| 47 } | 47 } |
| 48 | 48 |
| 49 web::BrowserState* EnhancedBookmarkModelFactory::GetBrowserStateToUse( | 49 web::BrowserState* EnhancedBookmarkModelFactory::GetBrowserStateToUse( |
| 50 web::BrowserState* context) const { | 50 web::BrowserState* context) const { |
| 51 return GetBrowserStateRedirectedInIncognito(context); | 51 return GetBrowserStateRedirectedInIncognito(context); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace enhanced_bookmarks | 54 } // namespace enhanced_bookmarks |
| OLD | NEW |