| 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/history/top_sites_factory.h" | 5 #include "ios/chrome/browser/history/top_sites_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "components/history/core/browser/history_constants.h" | 8 #include "components/history/core/browser/history_constants.h" |
| 9 #include "components/history/core/browser/top_sites_impl.h" | 9 #include "components/history/core/browser/top_sites_impl.h" |
| 10 #include "components/keyed_service/core/refcounted_keyed_service.h" | 10 #include "components/keyed_service/core/refcounted_keyed_service.h" |
| 11 #include "components/keyed_service/core/service_access_type.h" | 11 #include "components/keyed_service/core/service_access_type.h" |
| 12 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 12 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
| 13 #include "components/pref_registry/pref_registry_syncable.h" | 13 #include "components/pref_registry/pref_registry_syncable.h" |
| 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 14 #include "ios/chrome/browser/history/history_service_factory.h" | 15 #include "ios/chrome/browser/history/history_service_factory.h" |
| 15 #include "ios/chrome/browser/history/history_utils.h" | 16 #include "ios/chrome/browser/history/history_utils.h" |
| 16 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | |
| 17 #include "ios/web/public/web_thread.h" | 17 #include "ios/web/public/web_thread.h" |
| 18 | 18 |
| 19 namespace ios { | 19 namespace ios { |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 scoped_refptr<history::TopSites> TopSitesFactory::GetForBrowserState( | 22 scoped_refptr<history::TopSites> TopSitesFactory::GetForBrowserState( |
| 23 ios::ChromeBrowserState* browser_state) { | 23 ios::ChromeBrowserState* browser_state) { |
| 24 return make_scoped_refptr(static_cast<history::TopSites*>( | 24 return make_scoped_refptr(static_cast<history::TopSites*>( |
| 25 GetInstance()->GetServiceForBrowserState(browser_state, true).get())); | 25 GetInstance()->GetServiceForBrowserState(browser_state, true).get())); |
| 26 } | 26 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void TopSitesFactory::RegisterBrowserStatePrefs( | 58 void TopSitesFactory::RegisterBrowserStatePrefs( |
| 59 user_prefs::PrefRegistrySyncable* registry) { | 59 user_prefs::PrefRegistrySyncable* registry) { |
| 60 history::TopSitesImpl::RegisterPrefs(registry); | 60 history::TopSitesImpl::RegisterPrefs(registry); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool TopSitesFactory::ServiceIsNULLWhileTesting() const { | 63 bool TopSitesFactory::ServiceIsNULLWhileTesting() const { |
| 64 return true; | 64 return true; |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace ios | 67 } // namespace ios |
| OLD | NEW |