| 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/history_service_factory.h" | 5 #include "ios/chrome/browser/history/history_service_factory.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 8 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 9 #include "components/history/core/browser/history_database_params.h" | 11 #include "components/history/core/browser/history_database_params.h" |
| 10 #include "components/history/core/browser/history_service.h" | 12 #include "components/history/core/browser/history_service.h" |
| 11 #include "components/history/core/browser/visit_delegate.h" | 13 #include "components/history/core/browser/visit_delegate.h" |
| 12 #include "components/history/ios/browser/history_database_helper.h" | 14 #include "components/history/ios/browser/history_database_helper.h" |
| 13 #include "components/keyed_service/core/service_access_type.h" | 15 #include "components/keyed_service/core/service_access_type.h" |
| 14 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 16 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
| 15 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" | 17 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" |
| 16 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" | 18 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 new history::HistoryService( | 75 new history::HistoryService( |
| 74 make_scoped_ptr(new HistoryClientImpl( | 76 make_scoped_ptr(new HistoryClientImpl( |
| 75 ios::BookmarkModelFactory::GetForBrowserState(browser_state))), | 77 ios::BookmarkModelFactory::GetForBrowserState(browser_state))), |
| 76 nullptr)); | 78 nullptr)); |
| 77 if (!history_service->Init( | 79 if (!history_service->Init( |
| 78 browser_state->GetPrefs()->GetString(prefs::kAcceptLanguages), | 80 browser_state->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 79 history::HistoryDatabaseParamsForPath( | 81 history::HistoryDatabaseParamsForPath( |
| 80 browser_state->GetStatePath()))) { | 82 browser_state->GetStatePath()))) { |
| 81 return nullptr; | 83 return nullptr; |
| 82 } | 84 } |
| 83 return history_service.Pass(); | 85 return std::move(history_service); |
| 84 } | 86 } |
| 85 | 87 |
| 86 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse( | 88 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse( |
| 87 web::BrowserState* context) const { | 89 web::BrowserState* context) const { |
| 88 return GetBrowserStateRedirectedInIncognito(context); | 90 return GetBrowserStateRedirectedInIncognito(context); |
| 89 } | 91 } |
| 90 | 92 |
| 91 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { | 93 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { |
| 92 return true; | 94 return true; |
| 93 } | 95 } |
| 94 | 96 |
| 95 } // namespace ios | 97 } // namespace ios |
| OLD | NEW |