| 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> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "components/history/core/browser/history_database_params.h" | 10 #include "components/history/core/browser/history_database_params.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 scoped_ptr<KeyedService> HistoryServiceFactory::BuildServiceInstanceFor( | 70 scoped_ptr<KeyedService> HistoryServiceFactory::BuildServiceInstanceFor( |
| 71 web::BrowserState* context) const { | 71 web::BrowserState* context) const { |
| 72 ios::ChromeBrowserState* browser_state = | 72 ios::ChromeBrowserState* browser_state = |
| 73 ios::ChromeBrowserState::FromBrowserState(context); | 73 ios::ChromeBrowserState::FromBrowserState(context); |
| 74 scoped_ptr<history::HistoryService> history_service( | 74 scoped_ptr<history::HistoryService> history_service( |
| 75 new history::HistoryService( | 75 new history::HistoryService( |
| 76 make_scoped_ptr(new HistoryClientImpl( | 76 make_scoped_ptr(new HistoryClientImpl( |
| 77 ios::BookmarkModelFactory::GetForBrowserState(browser_state))), | 77 ios::BookmarkModelFactory::GetForBrowserState(browser_state))), |
| 78 nullptr)); | 78 nullptr)); |
| 79 if (!history_service->Init( | 79 if (!history_service->Init(history::HistoryDatabaseParamsForPath( |
| 80 browser_state->GetPrefs()->GetString(prefs::kAcceptLanguages), | 80 browser_state->GetStatePath()))) { |
| 81 history::HistoryDatabaseParamsForPath( | |
| 82 browser_state->GetStatePath()))) { | |
| 83 return nullptr; | 81 return nullptr; |
| 84 } | 82 } |
| 85 return std::move(history_service); | 83 return std::move(history_service); |
| 86 } | 84 } |
| 87 | 85 |
| 88 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse( | 86 web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse( |
| 89 web::BrowserState* context) const { | 87 web::BrowserState* context) const { |
| 90 return GetBrowserStateRedirectedInIncognito(context); | 88 return GetBrowserStateRedirectedInIncognito(context); |
| 91 } | 89 } |
| 92 | 90 |
| 93 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { | 91 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { |
| 94 return true; | 92 return true; |
| 95 } | 93 } |
| 96 | 94 |
| 97 } // namespace ios | 95 } // namespace ios |
| OLD | NEW |